echarts地图map城市间如何连线

2022-10-14,,,,

let bjdata = [
[{name:'北京'}, {name:'上海',value:95}],
[{name:'北京'}, {name:'广州',value:90}]
];

let convert = (data) => {
let res = [];
for (var i = 0; i < data.length; i++) {
var dataitem = data[i];
var from = geocoordmap[dataitem[0].name];
var to = geocoordmap[dataitem[1].name];
if (fromcoord && tocoord) {
res.push({
fromname: dataitem[0].name,
toname: dataitem[1].name,
coords: [from, to]
});
}
}

return res;
};


series: [
{
name: '北京',
type: 'lines',
zlevel: 1,
symbol: ['none'],
symbolsize: 10,
linestyle: {
normal: {
color: '#f00',
width: 1,
opacity: 0.6,
curveness: 0.2
}
},
data: convert(bjdata)
}

]





《echarts地图map城市间如何连线.doc》

下载本文的Word格式文档,以方便收藏与打印。