8000 How to refresh layer with Leaflet/OSM · Issue #17 · sunng87/heatcanvas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to refresh layer with Leaflet/OSM #17
Open
@mikekay01

Description

@mikekay01

How do I refresh my heatmap with new data in a Leaflet/OSM environment?

I can successfully build the map using:
heatmap = new L.TileLayer.HeatCanvas...

and can load the map using:
for (var i in MapData) {
console.log('data');
heatmap.pushData(MapData[i][0], MapData[i][1], MapData[i][2])
}

My problem is I do not know how to clear the heatmap and load new data.

I have tried using heatmap.clear(), but this seems to have no effect as everytime I push data into the heatmap it simply adds to the existing data.

Does anyone know how to basically clear the data from a heatmap, load new data in, and redraw the map?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0