-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add ability to fix map corner position during map.resize() #4269
Comments
Hmm any way to disable this? Or maybe I'm not understanding... after a |
Hello,
see working example (toggle sidebar on/off): This solution only works well for horizontal resizing, not vertical. |
I retitled this because the old title actually described the current behavior, and I think the intent was to request the alternative behavior. |
This would be a very useful feature for dynamic resizing events. |
Oh, yes this is actually very much wanted :) |
Map pitch is also not visually consistent across resize events, so would be good if both location and pitch remain visually consistent so that the map doesn't jump when resizing the window div programmatically. |
Does anyone else expect the map bounds to stay similar on resize, thereby changing the zoom? As a user, I think this makes more sense as it keeps the view roughly the same across resize. |
Depends on breakpoint, I'm trying to reduce motion on resizes, by attaching top left corner. Now resize seems to be centered. |
For anyone else running into this issue, I've created a codesandbox that shows how you can anchor a map to one corner when it expands (plus some timing delay to make the panel always appear on top of the map), without any visually jarring adjustments. The trick is to:
This could possibly be made more generic with some more math by adjusting center based on the new container's ∆x ∆y. But you'll always need to anchor the canvas with css to a desired corner to avoid unwanted movement. |
No description provided.
The text was updated successfully, but these errors were encountered: