kronick / HexgridHeatmap

A hexgrid-based heatmap for Mapbox GL JS
30 stars 10 forks source link

Hexgrid-based vector heatmaps for your Mapbox GL JS Maps

Usage

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:

var heatmap = new HexgridHeatmap(map, "hexgrid-heatmap", "waterway-label");
heatmap.setIntensity(15);
heatmap.setSpread(0.3);
heatmap.setData(sightseeingPOIs);
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)"]
]);