How to create a heatmap layer in Leaflet

Learn how to create a heatmap layer in Leaflet JavaScript library using the leaflet-maptilersdk plugin.

In this example, the heatmap layer is zoom-compensated and as a result the blobs roughly maintain their size in world-scale as we zoom-in/out. Download the earthquake sample data.


Replace YOUR_MAPTILER_API_KEY_HERE with your own API key. Make sure to protect the key before publishing your map app!

Learn more

Check out the Heatmap Layer Helper documentation and look at the Heatmap Helper examples to see the visualization possibilities.