Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap Gradient disapears when zooming in #136

Open
Jacobus1998 opened this issue Mar 26, 2024 · 0 comments
Open

Heatmap Gradient disapears when zooming in #136

Jacobus1998 opened this issue Mar 26, 2024 · 0 comments

Comments

@Jacobus1998
Copy link

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant