当前位置: 首页>>代码示例>>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;未经允许,请勿转载。