maptalks 绘制热力图
程序员文章站
2022-05-19 15:19:38
...
-
安装maptalks.heatmap插件
yarn add maptalks.heatmap --save
-
在页面import相关组件
import MaptalksCom from '@components/mapComponents/MaptalksCom' import { HeatLayer } from 'maptalks.heatmap'
-
准备数据,构建heatLayer,添加到map对象中
const addressPoints = [ [-37.8839, 175.3745188667, "571"], [-37.8869090667, 175.3657417333, "486"], [-37.8894207167, 175.4015351167, "807"], [-37.8927369333, 175.4087452333, "899"]] const heatlayer = new maptalks.HeatLayer('heat', data, { 'heatValueScale': 0.7, 'forceRenderOnRotating' : true, 'forceRenderOnMoving' : true }).addTo(map);
上一篇: CommonUtils