Incubator-echarts: echarts 不支持 highcharts 世界地图

Created on 7 Jun 2016  ·  8Comments  ·  Source: apache/incubator-echarts

问题简述 (One-line summary)

由于echarts官方提供的世界地图更新较慢,所以下载了highcharts提供的地图
http://code.highcharts.com/mapdata/
在地图上标注,无法正确识别经纬度

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):
  • 浏览器类型和版本 (Browser version):
  • 操作系统类型和版本 (OS Version):

    重现步骤 (Steps to reproduce)

1.打开官方示例 http://echarts.baidu.com/gallery/editor.html?c=effectScatter-map
2.修改series部分代码

series : [
        {
            name: 'Top 5',
            type: 'effectScatter',
            coordinateSystem: 'geo',
            markPoint: {
                symbol: 'emptyCircle',
                symbolSize: 50,
                effect : {
                    show: true,
                    shadowBlur : 0
                },
                itemStyle: {
                    normal: {
                        label: {show: false}
                    },
                    emphasis: {
                        label: {position: 'top'}
                    }
                },
                data: [
                    { coord : [121.48, 31.22], value: 20 }
                ]
            }
        }
    ]
  1. 通过js加载第三方地图

    期望结果 (Expected behaviour)

正确显示对应的经纬度标注点

可能哪里有问题 (What went wrong)

经查highcharts提供的地图中的 coordinates 值较大 和 echarts官方提供的数值有出入,
因该需要转换一下

ECharts配置项 (ECharts option)

option ={
            backgroundColor: '#404a59',
            dataRange: {
                min : 0,
                max : 100,
                x: 'right',
                calculable : true,
                color: ['#ff3333', 'orange', 'yellow','lime','aqua'],
                textStyle:{
                    color:'#fff'
                }
            },
            geo: {
                map: 'world',
                roam: false, // 是否开启漫游
                zoom: 1.2,
                nameMap: {},
                label: {
                    emphasis: {
                        textStyle: { color: '#FFF' }
                    }
                },
                itemStyle: {
                    normal: {
                        areaColor: '#323c48',
                        borderColor: '#111'
                    },
                    emphasis: { areaColor: '#2a333d' }
                }
            },
            series : [
                {
                    name: 'test',
                    type: 'effectScatter',
                    coordinateSystem: 'geo',

                    markPoint: {
                        symbol: 'circle',
                        symbolSize: 100,
                        itemStyle: {
                            normal: {
                                borderWidth: 2,
                                borderColor: 'red',
                                color: 'transparent',
                                label: {show: false}
                            }
                        },
                        data: [
                            { coord : [121.48, 31], value: 20 }
                        ]
                    }
                }
            ]
        }

// other
echarts.registerMap('world', worldJson);

其他信息 (Other comments)

highcharts 提供的数据
20160607115117_1

echarts数据
20160607115150

inactive support

Most helpful comment

echarts 世界地图的数据从 http://www.naturalearthdata.com/ 获取,你也可以根据需要更新,各个国家的轮廓数据我之前也整理了下 https://github.com/pissang/starbucks/tree/gh-pages/json

All 8 comments

highcharts 的数据是 encode 过的

好吧, 有空自己扒下代码 看能不能转回来。。。

echarts 世界地图的数据从 http://www.naturalearthdata.com/ 获取,你也可以根据需要更新,各个国家的轮廓数据我之前也整理了下 https://github.com/pissang/starbucks/tree/gh-pages/json

@pissang 感谢!

Thanks for the link to maps repo @pissang!

地图轮廓数据链接太有用了,同样超感谢 @pissang

地图轮廓数据链接十分特别有用,同样超感谢 @pissang

This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.

Was this page helpful?
0 / 5 - 0 ratings