GuillaumeAmat/leaflet-overpass-layer

Min zoom constraint isn't followed when you zoom in and out

KillianKemps opened this issue · 2 comments

By default there is a minimum zoom constraint at 15.
Indeed you have to zoom in to at least the level 15 to display the markers.

However, once you zoom out to a higher level like 13, new markers keep being displayed.
With the queries I'm using, it's beginning to be a lot of markers.

It would be nice that requests to OverPass are made only when the zoom is at least at the one configured and that it keeps this setting.

screenshot from 2018-02-13 22-02-11

Hi @KillianKemps, actually the plugin requests Overpass only when the zoom level is below the constraint. But when the request is done, the bounding box is enlarged to cover a bigger zone. The main purpose was to reduce the number of requests because the most common behavior is to load a map and pan it. That way you do not launch requests when you pan your map on a specific zone.

So when you zoom out, you see the points that have been previously fetched.

I suggest you to use the Marker Cluster plugin to reduce the number of displayed points.

Thank you for you answer, okay I understand better the behaviour and thank you for the link, I will use the clusters then :).