Skip to content
On this page

热力图

heatmapAddByGeoJson

javascript
(data,comp)=>{
    comp.heatmapAddByGeoJson([
    {lnglat:[lng,lat],weight:1}
    ],errCallback,succCallBack,options)
}
(data,comp)=>{
    comp.heatmapAddByGeoJson([
    {lnglat:[lng,lat],weight:1}
    ],errCallback,succCallBack,options)
}

备注:options可覆盖热力图颜色配置

javascript
{
    "heatmap-weight": [
        "interpolate",
        ["linear"],
        ["get", "weight"],
        0, 0,
        6, 1
    ],
    "heatmap-intensity": [
        "interpolate",
        ["linear"],
        ["zoom"],
        0, 1,
        9, 3
    ],
    "heatmap-color": [
        "interpolate",
        ["linear"],
        ["heatmap-density"],
        0, "rgba(255,0,0,0)",
        0.2, "rgba(255,0,0,0.2)",
        0.4, "rgba(255,0,0,0.4)",
        0.6, "rgba(255,0,0,0.6)",
        0.8, "rgba(255,0,0,0.8)",
        1, "rgba(255,0,0,1)"
    ],
    "heatmap-radius": [
        "interpolate",
        ["linear"],
        ["zoom"],
        0, 2,
        9, 20
    ],
    "heatmap-opacity": [
        "interpolate",
        ["linear"],
        ["zoom"],
        7, 1,
        9, 0
    ],
}
{
    "heatmap-weight": [
        "interpolate",
        ["linear"],
        ["get", "weight"],
        0, 0,
        6, 1
    ],
    "heatmap-intensity": [
        "interpolate",
        ["linear"],
        ["zoom"],
        0, 1,
        9, 3
    ],
    "heatmap-color": [
        "interpolate",
        ["linear"],
        ["heatmap-density"],
        0, "rgba(255,0,0,0)",
        0.2, "rgba(255,0,0,0.2)",
        0.4, "rgba(255,0,0,0.4)",
        0.6, "rgba(255,0,0,0.6)",
        0.8, "rgba(255,0,0,0.8)",
        1, "rgba(255,0,0,1)"
    ],
    "heatmap-radius": [
        "interpolate",
        ["linear"],
        ["zoom"],
        0, 2,
        9, 20
    ],
    "heatmap-opacity": [
        "interpolate",
        ["linear"],
        ["zoom"],
        7, 1,
        9, 0
    ],
}

heatmapLayerDel

javascript
(data,comp)=>{
    comp.heatmapLayerDel()
}
(data,comp)=>{
    comp.heatmapLayerDel()
}

Last updated: