如代码所示,我每次重新设置option更新数据的时候mapbox都会刷新一遍,这就使展示效果很不好,有没有什么解决办法?echarts3有timeline,echarts-gl我看文档好像没有timeline
配置项如下
mapboxgl.accessToken = 'pk.eyJ1IjoibHljb25nY29uZzEyMTQiLCJhIjoiY2o0OWhweWVuMHhlcDMzcWx6NmdhdzlzcCJ9.HVDr3_lwl9mUvk0Rrdo2iw';
option = {
backgroundColor: '#cdcfd5',
mapbox: {
center: [116.39135255251477, 39.90769983111901],
zoom: 14,
pitch: 60,
style: 'mapbox://styles/lycongcong1214/cj4b2fu1k457m2so4dxx8sltb',
altitudeScale: 3e2,
postEffect: {
enable: true,
screenSpaceAmbientOcculusion: {
enable: true,
radius: 2
}
},
light: {
main: {
intensity: 2,
shadow: true,
shadowQuality: 'high'
},
ambient: {
intensity: 0
},
ambientCubemap: {
texture: 'asset/canyon.hdr',
exposure: 2,
diffuseIntensity: 0.5
}
}
},
visualMap: {
max: 10,
calculable: true,
realtime: false,
inRange: {
color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
},
outOfRange: {
colorAlpha: 0
}
},
series: [{
type: 'bar3D',
coordinateSystem: 'mapbox',
shading: 'lambert',
data: [
[116.39135255251477, 39.90769983111901, 10],
[116.33398696424165, 39.97466422551993, 2]
],
barSize: 0.5,
minHeight: 0.2,
silent: true,
itemStyle: {
color: 'orange'
// opacity: 0.8
},
/*
label:{
show:true,
formatter:'{c}'
}
*/
}]
};
function updateData(index){
myChart.setOption({
series:[{data:[
[116.39135255251477, 39.90769983111901, 2],
[116.33398696424165, 39.97466422551993, 10]
]}]
})
}
var t1 = window.setInterval(updateData,5000);