當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript topojson.feature函數代碼示例

本文整理匯總了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;
         }
     }
 });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:10,代碼來源:USStates.ts

示例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();
 });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:11,代碼來源:TopoJSON.ts

示例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;
                    }
                }

            });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:12,代碼來源:USCounties.ts

示例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;
 }
開發者ID:phonofidelic,項目名稱:map-tools,代碼行數:18,代碼來源:addFeature.ts

示例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;
 }
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:15,代碼來源:TopoJSON.ts

示例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();
                }
            });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:16,代碼來源:TopoJSONChoropleth.ts

示例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[]; }
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:6,代碼來源:topojson-tests.ts

示例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[]; }
開發者ID:kittimiyo,項目名稱:DefinitelyTyped,代碼行數:6,代碼來源:topojson-tests.ts


注:本文中的topojson.feature函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。