heatmap.js icon indicating copy to clipboard operation
heatmap.js copied to clipboard

Heatmap layer changes on zoom and scroll

Open meliborn opened this issue 8 years ago • 2 comments

Here is an example of what I'm talking about https://monosnap.com/file/RlCBVesSFsBHEaJP7KaHzzS4aNeavp#embed

I'm expecting to see constant layer without any changes even on zoom or scroll. Am I missing something?

meliborn avatar Mar 26 '17 14:03 meliborn

it looks like you're having useLocalExtremas set to true. in that case it will look for the highest visible point and use that as maximum for the heatmap, disable it and it should behave properly

pa7 avatar Mar 27 '17 01:03 pa7

You can extend the boundingbox using the pad function. http://leafletjs.com/reference-1.3.0.html#latlngbounds At the leaflet-heatmap.js https://github.com/pa7/heatmap.js/blob/develop/plugins/leaflet-heatmap/leaflet-heatmap.js

ln: 101 Add the following: bounds = bounds.pad(0.1);

Using this line you are extending the current bounds by 10% and this will fix the rendering issue of zooming and dragging.

tomchavakis avatar Feb 01 '18 21:02 tomchavakis