配置项如下
var uploadedDataURL = "/asset/get/s/data-1511515263748-HkOt4PSgz.json";
$.get(uploadedDataURL, function(zzJson) {
alert(uploadedDataURL)
//echarts.registerMap('漳州', mian);
var option;
var busLines = [];
var data = zzJson;
alert(zzJson)
var hStep = 300 / (data.length - 1);
//添加busLines信息
for (var x in data) {
var line = data[x];
var pointString = line.ROAD_LINE;
var pointArr = pointString.split(";");
var lnglats = [];
for (var j in pointArr) {
lnglats.push(pointArr[j].split(','));
}
busLines.push({
coords: lnglats,
lineStyle: {
color: echarts.color.modifyHSL('#6af80b', Math.round(hStep * x))
}
});
}
option = {
bmap: {
center: [117.680453, 24.51893],
zoom: 14,
roam: true,
mapStyle: {
'styleJson': [
{
"featureType": "road",
"elementType": "all",
"stylers": {
"visibility": "on"
}
}, {
"featureType": "background",
"elementType": "all",
"stylers": {
"visibility": "off"
}
}, {
"featureType": "poilabel",
"elementType": "all",
"stylers": {
"visibility": "off"
}
}, {
"featureType": "administrative",
"elementType": "all",
"stylers": {
"visibility": "off"
}
}
]
}
},
series: [{
name: '漳州',
map: '漳州',
type: 'map',
zoom: 3,
aspectScale: 1, //长宽比. default: 0.75
roam: false,
itemStyle: {
emphasis: {
label: {
show: true
}
}
},
data: []
}, {
type: 'lines',
coordinateSystem: 'bmap',
//polyline:true,
data: busLines,
silent: true,
lineStyle: {
normal: {
opacity: 0.2,
width: 0.5
}
},
progressiveThreshold: 500,
progressive: 200
}, {
type: 'lines',
coordinateSystem: 'bmap',
polyline: true,
data: busLines,
lineStyle: {
normal: {
width: 0,
color: '#f69305'
}
},
effect: {
constantSpeed: 50,
show: true,
trailLength: 0.2,
symbolSize: 5
},
zlevel: 1
}]
};
var myChart = echarts.init(document.getElementById("main"));
myChart.setOption(option);
}); //异步2结束