使用supermap 制作迁徙图时,有两种方式:mapv 和echarts;但是mapv的参数设置不详细,不如直接使用echarts。另外,npm 安装后需要注意一下:supermap iclient for openlayers在使用时,没有类似supermap iclient for leaflet 类似的使用示例(至少目前没有),在使用时参考openlayers的使用,supermap封装的方法需要找到node_modules/@supermap目录下的对应的方法。
准备工作:
npm install @supermap/iclient-ol
npm install ol-echarts --save
代码模块:
import EChartsLayer from "ol-echarts/dist/ol-echarts.common";
使用
that.echartslayer = new EChartsLayer(null, {
hideOnMoving: true,
hideOnZooming: true,
forcedPrecomposeRerender: true
});
that.echartslayer.appendTo(that.map);
参数填入:
addeChart(arr) {
var color = "#a6c84c";
var planePath = "./img/state-icon.png";
let series = [];