设置为 series 为空数组后,迁徙图有残影。
配置项如下
option = {
bmap: {
center: [106.631881, 26.642758],
zoom: 11,
resizeEnable: true,
roam: true,
mapStyle: {
'styleJson': [{
'featureType': 'water',
'elementType': 'all',
'stylers': {
'color': '#031628'
}
},
{
'featureType': 'land',
'elementType': 'geometry',
'stylers': {
'color': '#000102'
}
},
{
'featureType': 'highway',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'arterial',
'elementType': 'geometry.stroke',
'stylers': {
'color': '#0b3d51'
}
},
{
'featureType': 'local',
'elementType': 'geometry',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'railway',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'railway',
'elementType': 'geometry.stroke',
'stylers': {
'color': '#08304b'
}
},
{
'featureType': 'subway',
'elementType': 'geometry',
'stylers': {
'lightness': -70
}
},
{
'featureType': 'building',
'elementType': 'geometry.fill',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'all',
'elementType': 'labels.text.fill',
'stylers': {
'color': '#857f7f'
}
},
{
'featureType': 'all',
'elementType': 'labels.text.stroke',
'stylers': {
'color': '#000000'
}
},
{
'featureType': 'building',
'elementType': 'geometry',
'stylers': {
'color': '#022338'
}
},
{
'featureType': 'green',
'elementType': 'geometry',
'stylers': {
'color': '#062032'
}
},
{
'featureType': 'boundary',
'elementType': 'all',
'stylers': {
'color': '#465b6c'
}
},
{
'featureType': 'manmade',
'elementType': 'all',
'stylers': {
'color': '#022338'
}
},
{
'featureType': 'label',
'elementType': 'all',
'stylers': {
'visibility': 'off'
}
}
]
}
},
series: [{
name: 'POINT',
type: 'effectScatter',
coordinateSystem: 'bmap',
rippleEffect: {
brushType: 'stroke',
period: 4,
scale: 4
},
label: {
show: false,
position: 'right',
formatter: '{b}'
},
itemStyle: {
color: '#3ed4ff'
},
data: [{
kind: 'POINT',
name: '乌当区',
value: [106.821057, 26.669621, 1058]
},
{
kind: 'POINT',
name: '贵阳市',
value: [106.703183, 26.781471, 2140]
},
{
kind: 'POINT',
name: '观山湖区',
value: [106.549319, 26.659037, 2822]
},
{
kind: 'POINT',
name: '云岩区',
value: [106.724528, 26.604744, 4699]
},
{
kind: 'POINT',
name: '南明区',
value: [106.774703, 26.541612, 4886]
},
{
kind: 'POINT',
name: '修文县',
value: [106.591841, 26.838995, 820]
},
{
kind: 'POINT',
name: '白云区',
value: [106.678219, 26.727732, 1721]
}
],
tooltip: {
show: true
}
},
{
name: 'POINT2',
type: 'effectScatter',
coordinateSystem: 'bmap',
rippleEffect: {
brushType: 'stroke',
period: 4,
scale: 4
},
label: {
show: false,
position: 'right',
formatter: '{b}'
},
itemStyle: {
color: '#ffa022'
},
data: [{
kind: 'POINT2',
name: 'AAA',
value: [106.800718, 26.633137, 1058]
},
{
kind: 'POINT2',
name: 'BBB',
value: [106.597621, 26.719608, 2140]
},
{
kind: 'POINT2',
name: 'CCC',
value: [106.561509, 26.784871, 15460]
}
]
},
{
name: 'AAA',
type: 'lines',
coordinateSystem: 'bmap',
animation: false,
effect: {
show: true,
period: 4,
trailLength: 0.02,
symbol: 'arrow',
symbolSize: 6,
color: '#3ed4ff'
},
lineStyle: {
color: '#3ed4ff',
width: 1,
opacity: 1,
curveness: 0.3
},
data: [{
coords: [
[106.821057, 26.669621],
[106.800718, 26.633137]
]
}]
},
{
name: 'BBB',
type: 'lines',
coordinateSystem: 'bmap',
animation: false,
effect: {
show: true,
period: 4,
trailLength: 0.02,
symbol: 'arrow',
symbolSize: 6,
color: '#ffa022'
},
lineStyle: {
color: '#ffa022',
width: 1,
opacity: 1,
curveness: 0.3
},
data: [{
coords: [
[106.703183, 26.781471],
[106.597621, 26.719608]
]
}]
},
{
name: 'CCC',
type: 'lines',
coordinateSystem: 'bmap',
animation: false,
effect: {
show: true,
period: 4,
trailLength: 0.02,
symbol: 'arrow',
symbolSize: 6,
color: '#a6c84c'
},
lineStyle: {
color: '#a6c84c',
width: 1,
opacity: 1,
curveness: 0.3
},
data: [{
coords: [
[106.549319, 26.659037],
[106.561509, 26.784871]
]
},
{
coords: [
[106.724528, 26.604744],
[106.561509, 26.784871]
]
},
{
coords: [
[106.774703, 26.541612],
[106.561509, 26.784871]
]
},
{
coords: [
[106.703183, 26.781471],
[106.561509, 26.784871]
]
},
{
coords: [
[106.591841, 26.838995],
[106.561509, 26.784871]
]
},
{
coords: [
[106.678219, 26.727732],
[106.561509, 26.784871]
]
}
]
}
]
}
setTimeout(function() {
alert('开始清空series aaa');
const opts = echarts.util.clone(option)
opts.series = []
myChart.setOption(opts);
}, 5000);
setTimeout(function() {
alert('开始清空series bbb');
const opts = echarts.util.clone(option)
opts.series = []
myChart.setOption(opts, true);
}, 10000);