本文整理匯總了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[]; }