本文整理汇总了TypeScript中topojson.feature函数的典型用法代码示例。如果您正苦于以下问题:TypeScript feature函数的具体用法?TypeScript feature怎么用?TypeScript feature使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feature函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}).then((usStates: any) => {
this._features = topojson.feature(usStates.topology, usStates.topology.objects.states).features;
for (const key in this._features) {
if (this._features[key].id) {
const { code, name } = usStates.stateNames[this._features[key].id];
this._features[key].properties.hpccID = code;
usStateNames[code] = name;
}
}
});
示例2: d3Json
d3Json(`${topoJsonFolder()}/us-counties.json`, function (_usCounties) {
usCounties = _usCounties;
features = topojson.feature(usCounties.topology, usCounties.topology.objects.counties).features;
rFeatures = {};
for (const key in features) {
if (features[key].id) {
rFeatures[features[key].id] = features[key];
}
}
resolve();
});
示例3:
}).then((usCounties: any) => {
this._features = topojson.feature(usCounties.topology, usCounties.topology.objects.counties).features;
for (const key in this._features) {
if (this._features[key].id) {
const code = this._features[key].id;
const name = usCounties.countyNames[code];
this._features[key].properties.hpccID = code;
usCountyNames[code] = name;
}
}
});
示例4: addTopoJson
/**
* Adds a Topo JSON file into a Map
* @param data The parsed JSON File
* @param options
*/
function addTopoJson(data, options:TopoJsonOption[]): {}[] {
var item, geoJson, features, x;
for (x in options) {
if (options.hasOwnProperty(x)) {
item = options[x];
geoJson = topojson.feature(data, data.objects[item.object]);
features = that.instance.data.addGeoJson(geoJson);
addFeatureOptions(features, item);
global.mapTools.maps[that.id].json.all[item.object] = features;
}
}
return features;
}
示例5: addData
addData(data) {
let geojson;
let key;
if (data.type === "Topology") {
for (key in data.objects) {
if (data.objects.hasOwnProperty(key)) {
geojson = topojson.feature(data, data.objects[key]);
super.addData.call(this, geojson);
}
}
return this;
}
super.addData.call(this, data);
return this;
}
示例6: d3Json
d3Json(`${topoJsonFolder()}/${context.region()}.json`, function (region) {
context._choroTopology = region;
context._choroTopologyObjects = region.objects.PolbndA;
context._choroTopologyFeatures = topojson.feature(context._choroTopology, context._choroTopologyObjects).features;
d3Json(`${topoJsonFolder()}/${context.region()}_idx.json`, indexLoad)
.on("error", function (err) {
indexLoad({});
})
;
function indexLoad(index) {
context._choroTopologyIndex = index;
resolve();
}
});
示例7:
import * as topojson from 'topojson';
// TODO: complete tests.
topojson.feature(null, null); // $ExpectType { features: any[]; type: string; }
topojson.mesh(null, null, (a: any, b: any) => a !== b); // $ExpectType { type: any; coordinates: any[]; }
示例8:
import * as topojson from 'topojson';
// TODO: complete tests.
topojson.feature(null, null); // $ExpectType { features: any[]; }
topojson.mesh(null, null, (a: any, b: any) => a !== b); // $ExpectType { type: any; coordinates: any[]; }