maptalks 绘制热力图
作者:互联网
-
安装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);
标签:map,const,HeatLayer,maptalks,力图,heatmap,import,绘制 来源: https://blog.csdn.net/a2011102394/article/details/91346915