05 · Heatmap
A HeatmapLayer over 500 points, its colour ramp cycling every few seconds. Without a max, the densest spot in view is the top of the ramp and everything else is shaded against it.
Open it full screen · Edit and run it · Full source: 05-heatmap.ts
const heat = new HeatmapLayer({
data: points, // [{ lat, lng, weight }]
radius: 25,
blur: 20,
gradient: { 0.4: 'blue', 0.6: 'cyan', 0.7: 'lime', 0.8: 'yellow', 1.0: 'red' },
})
heat.addTo(map)