1、获取地图数据
datav.aliyun.com/tools/atlas…
DataV
有着你所需要的各种地图数据
2、获取地图json数据
this.$axios.get("../static/370200.json").then((res) => {
this.mapData = res.data; //地图数据
});
3、重绘
document.getElementById('e1').removeAttribute('_echarts_instance_');
this.init();
如果数据没有变化,只执行init函数,图表不会重新绘制,需要执行document.getElementById('e1').removeAttribute('_echarts_instance_');
这一行代码,移除echarts_instance
属性,如果没有此属性,地图就会进行重绘