Skip to content

HeatmapLayer

HeatmapLayer

热力图层类

继承BaseLayer

Examples

javascript
const heatmapLayer = new DiMap.HeatmapLayer({
 max: 100,
 radius: 25,
 opacity: 0.7
})
heatmapLayer.addFeature(new DiMap.heatmapFeature({...}))
heatmapLayer.addToMap(map)
heatmapLayer.on("click", () => {
 console.log("click")
})

constructor

Parameters

HeatmapLayerOptions

热力图图层配置项

Properties

  • layout HeatmapLayout? 热力图图层布局
  • paint HeatmapPaint? 热力图图层样式
  • minzoom number? 热力图层最小缩放层级
  • maxzoom number? 热力图层最大缩放层级
  • max number? 热力值权重最大值,默认自动计算。此项决定热力相对的颜色深浅,越接近权重最大值的,颜色越深
  • radius number? 热力图半径,单位像素,默认 30
  • opacity number? 热力图透明度,范围 0-1,默认 0.8