欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maptalks 绘制热力图

程序员文章站 2022-05-19 15:19:38
...
  1. 安装maptalks.heatmap插件

    	yarn add maptalks.heatmap --save
    
  2. 在页面import相关组件

        import MaptalksCom from '@components/mapComponents/MaptalksCom'
        import { HeatLayer } from 'maptalks.heatmap'
    
  3. 准备数据,构建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);
    
    
相关标签: maptalks 热力图