-
Notifications
You must be signed in to change notification settings - Fork 12
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
Double size of outer bounds #1
Comments
Nope, the outer bounds for either is the whole world. You can see this if you zoom out to zoom level 1 or 2. I suspect what you're seeing is the transition between zoom levels, where Leaflet takes a moment to fill in the area that was not already filled (previous bbox to new bbox). Not sure there's much we can do about that! |
The outer bounds with unfilled areas outside, observed while panning and zooming out, are those of the vector renderer. The renderer bounds are limited to the map view plus some buffer, that can be adjusted with the padding option. With a padding of 1 (size of map view in each direction; default 0.1), the undesired effect is mostly gone: L.geoJson(data, {
invert: true,
renderer: L.svg({ padding: 1 })
}).addTo(map); By assigning a new renderer instance (since Leaflet 1.0), this doesn't affect other vector layers, see also second SVG Usage example. |
@nrenner This is a great tip, thank you for it! |
is it right that the outer bounds of the (multi)polygon is the bbox of the current view?
if you zoom out you could see this bounds for short time. maybe double the size of this bound that you didn't see it if you only zoom out one zoom level.
The text was updated successfully, but these errors were encountered: