You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This a suggestion for a tweak to the maxBounds setting. (It may be too niche, so feel free to reject it :))
Currently a map's maxBounds specifies that the four corners of the map will never be outside the lat/long boundaries of the maxBounds. I am finding that sometimes this isn't ideal, when you have controls or overlays sitting inside the map area.
A concrete example:
I have the western boundary of maxBounds set to 140, which is the western boundary of the state of Victoria. (This particular map is for a state-based agency). Minzoom is 6 (which shows the whole state).
There is a legend sitting just inside the left margin of the map, 315px wide out of 890px. (It's not very tall, so doesn't obscure much space).
Problem: when the user zooms out fully, part of the state is obscured by the legend.
Solution 1: move the western boundary of maxBounds a lot further west, which isn't ideal, as it creates a huge amount of area where the user could get lost, at higher zooms.
Solution 2: decrease minZoom, which creates more issues for data preparation and cartography, and also doesn't totally solve the problem of the user wanting to see lots of the state at a higher zoom level.
Proposed solution: allow some kind of maxBoundsBuffer setting which changes the definition of maxBounds. Instead of the four corners being constrained to the maxBounds, a rectangle inset by maxBoundsBuffer will be constrained. So in my case, the user could pan 315px further left than currently, so the legend doesn't obscure the map.
The text was updated successfully, but these errors were encountered:
#4268 was apparently addressed by #8638. However, it doesn't seem to help for maxBounds but instead helps with fitBounds | flyTo | easeTo type functions. Is the fix to use Map.padding or Map.setPadding in combination with maxBounds? This feels really disjointed.
This a suggestion for a tweak to the
maxBounds
setting. (It may be too niche, so feel free to reject it :))Currently a map's
maxBounds
specifies that the four corners of the map will never be outside the lat/long boundaries of themaxBounds
. I am finding that sometimes this isn't ideal, when you have controls or overlays sitting inside the map area.A concrete example:
maxBounds
set to 140, which is the western boundary of the state of Victoria. (This particular map is for a state-based agency). Minzoom is 6 (which shows the whole state).maxBounds
a lot further west, which isn't ideal, as it creates a huge amount of area where the user could get lost, at higher zooms.minZoom
, which creates more issues for data preparation and cartography, and also doesn't totally solve the problem of the user wanting to see lots of the state at a higher zoom level.Proposed solution: allow some kind of
maxBoundsBuffer
setting which changes the definition of maxBounds. Instead of the four corners being constrained to the maxBounds, a rectangle inset bymaxBoundsBuffer
will be constrained. So in my case, the user could pan 315px further left than currently, so the legend doesn't obscure the map.The text was updated successfully, but these errors were encountered: