当前位置:   article > 正文

openlayers 5.0 热力图_openlayers mapv

openlayers mapv
import Vector from 'ol/source/Vector.js'
import { Heatmap as HeatmapLayer } from 'ol/layer.js'
import Feature from 'ol/Feature.js'
import Point from 'ol/geom/Point.js'
var webgissource={};
webgissource.heatmapsource=new Vector()
webgissource.heatmapvector = new HeatmapLayer({
    // 矢量数据源
   source: webgissource.heatmapsource,
    blur:  parseInt(50, 10), // 模糊尺寸
    opacity: 1,
    radius: parseInt(30, 10) // 热点半径
   })
map.addLayer(webgissource.heatmapvector);   

static heatmaplayer(data){
//data数据格式{x:107.4,y108.5}  for循环执行heatmaplayer()
   var points=new Point([data.x,data.y]);
   var iconFeature = new Feature({
      geometry:points,
      attributions:{
        feature:data,
        type:'rlt'
      }
    })
    webgissource.heatmapvector.getSource().addFeature(iconFeature)
  }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/990619?site
推荐阅读
相关标签
  

闽ICP备14008679号