由于echarts官方提供的世界地图更新较慢,所以下载了highcharts提供的地图
http://code.highcharts.com/mapdata/
在地图上标注,无法正确识别经纬度
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 }
]
}
}
]
正确显示对应的经纬度标注点
经查highcharts提供的地图中的 coordinates 值较大 和 echarts官方提供的数值有出入,
因该需要转换一下
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);
highcharts 提供的数据

echarts数据

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