echarts定时渲染地图出现浏览器内存溢出问题(echarts渲染刷新导致浏览器卡)
处理方式:
1)将定时变化的option内容单独提取定时刷新
2)使用定时器更新渲染图层和删除定时器
例如:
function Z(data) { var x = 119.557082; var y = 26.659241; var zoom = 14; var points = data || [[]] var chart = echarts.init(document.getElementById("box")); chart.clear() chart.setOption({bmap:[{ center: [x,y], zoom: zoom}], series: [{ type: 'heatmap', coordinateSystem: 'bmap', data: points, pointSize: 5, blurSize: 6 }] },{notMerge: false, lazyUpdate: false, silent:false}) } areaBar(data) $(function(){ var timer = setInterval(function() { clearInterval(timer); // 下面处理业务 Z(data) }, 5000) })
感谢:https://blog.csdn.net/wrkd35/article/details/106713987/
https://www.haorooms.com/post/javascript_neicun_use