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',
1,
opacity: 0.6,
curveness: 0.2
}
},
data: convert(bjData)
}
]