echarts-maps / echarts-china-cities-js

Packages the maps of Chinese cities for echarts.

Home Page:https://echarts-maps.github.io/echarts-china-cities-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

城市.js如何转换成json

angwangiot opened this issue · comments

在Angular 6中使用,是否可以将JS中的描述转换成json来使用,如http://www.echartsjs.com/examples/editor.html?c=map-HK

commented

可以。请参考echarts-mapmaker的decompress 命令

好的,感谢

可以。请参考echarts-mapmaker的decompress 命令

请问taiwan.js、 chongqing.js、 shanghai.js decompress命令说无法处理!
具体代码 :decompress chongqing.js chongqing.json
错误提示:C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\src\maker.js:157
throw new Error('Cannot handle js file');
^

Error: Cannot handle js file
at Object.jsToGeoJson [as decompress] (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\src\maker.js:157:13)
at Command. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\src\decompress.js:9:11)
at Command.listener (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\node_modules\commander\index.js:315:8)
at Command.emit (events.js:189:13)
at Command.parseArgs (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\node_modules\commander\index.js:653:12)
at Command.parse (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\node_modules\commander\index.js:474:21)
at Object. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\echarts-mapmaker\src\decompress.js:11:4)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)

commented

下面是我的正式回应,有其他需求,请另提。

Screenshot 2019-05-06 at 06 19 05

https://github.com/echarts-maps/echarts-china-cities-js/tree/master/geojson

commented

@shimangdian , 是有问题。这个commit 解决了:echarts-maps/echarts-mapmaker@2d7e043