heloowird opened a new issue #9158: 加载GeoJSON地图数据失败
URL: https://github.com/apache/incubator-echarts/issues/9158
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   
加载GeoJSON地图数据失败,GeoJSON数据:[nanchang_geo.json](http://polygons.openstreetmap.fr/get_geojson.py?id=3169865&params=0)
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 
http://www.echartsjs.com/gallery/vendors/echarts/echarts.js
   + Browser version [浏览器类型和版本]: 69.0.3497.100
   + OS Version [操作系统类型和版本]: macOS Sierra 10.12.6
   
   
   
   
   
   ### Expected behaviour [期望结果]
   
   成功加载自定义GeoJSON,并自定义GeoJson上可绘制rect
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   参考示例:http://echarts.baidu.com/examples/editor.html?c=map-bin
   ```javascript
   ...
   function loadData(url) {
      var json = null;
       $.ajax({
           'async': false,
           'global': false,
           'url': url,
           'dataType': "json",
           'success': function (data) {
               json = data;
           }
       });
       return json; 
   };
   var nanchangJson = loadData("data/geo7/nanchang_geo.json");
   echarts.registerMap('NC', nanchangJson);
   ...
   option = {
   tooltip: {},
       visualMap: {
           type: 'piecewise',
           inverse: true,
           top: 10,
           left: 10,
           pieces: [{
               value: 0, color: COLORS[0]
           }, {
               value: 1, color: COLORS[1]
           }, {
               value: 2, color: COLORS[2]
           }, {
               value: 3, color: COLORS[3]
           }, {
               value: 4, color: COLORS[4]
           }, {
               value: 5, color: COLORS[5]
           }],
           borderColor: '#ccc',
           borderWidth: 2,
           backgroundColor: '#eee',
           dimension: 2,
           inRange: {
               color: COLORS,
               opacity: 0.7
           }
       },
       series: [
           {
               type: 'custom',
               coordinateSystem: 'geo',
               renderItem: renderItem,
               animation: false,
               itemStyle: {
                   emphasis: {
                       color: 'yellow'
                   }
               },
               encode: {
                   tooltip: 2
               },
               data: data["2018-08-22-19"]
           }
       ],
       geo: {
           map: 'NC',
           center: [115.99755, 28.64398],
           zoom: 12,
           roam: true
       }
   }
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   ```
   echarts.js:44924 Uncaught TypeError: Cannot read property 'length' of 
undefined
       at getBoundingRect$1 (echarts.js:44924)
       at Object.load (echarts.js:44917)
       at echarts.js:45108
       at Array.forEach (<anonymous>)
       at each$1 (echarts.js:528)
       at Object.load (echarts.js:45107)
       at Object.getFilledRegions (echarts.js:45611)
       at ExtendedClass.optionUpdated (echarts.js:76283)
       at ExtendedClass.<anonymous> (echarts.js:20782)
       at Array.forEach (<anonymous>)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to