Leaflet/Leaflet.heat

Heatmap Gradient disapears when zooming in

Jacobus1998 opened this issue · 0 comments

Im using leaflet.heat in react.

When zooming in on the heatmap the gradient of the heatmap changes to a single colour and does not retain its original colours in the position. For instance when zoomed out there is a orange area on the map but when zooming in it gets to a point where all the heat points become blue. Is there a way to prevent this and keep the area the same colour that it was when zoomed out?

The following is the image of when it is zoomed out.
Screenshot 2024-03-26 at 10 12 32

When starting to zoom in it changes the gradient to the following.
Screenshot 2024-03-26 at 10 13 17

And then finally it reaches a point where everything is blue.
Screenshot 2024-03-26 at 10 13 03

Is there a way to use keep the gradient of the zoomed out map in the zoomed in map?

My current heatmap layer code is as follows:
L.heatLayer(heatmapPoints , { max: max, maxZoom:8 , radius:10 , blur:15, minOpacity: 0.7}).addTo(mapRef);