See the examples directory for an example of usage. You will need to provide your own Mabox access token to view the map.
Here's how it works:
HexgridHeatmap
. It will automatically add the necessary layer and events to the specified map:var heatmap = new HexgridHeatmap(map, "hexgrid-heatmap", "waterway-label");
heatmap.setIntensity(15);
heatmap.setSpread(0.3);
FeatureCollection
full of points to mapheatmap.setData(sightseeingPOIs);
update()
after changing settings. The heatmap will automatically call update() when moving and zooming the map.heatmap.update();
heatmap.setColorStops([
[0, "rgba(0,185,243,0)"],
[50, "rgba(0,185,243,0.5)"],
[130, "rgba(255,223,0,0.6)"],
[200, "rgba(255,105,0,0.6)"]
]);