-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
drag to rotate breaks if the maps bearing/pitch is changed inside of a move event #4104
Comments
I believe you should use CameraUpdateTransform instead. |
Nice hadn't seen that, works perfectly for our use case, thanks. I'll leave the issue open as this behaviour still seems like a bug, given the compass handles it correctly. |
I believe this is a duplicate of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
maplibre-gl-js version: 4.2.0
browser: Tested on Vivaldi, Firefox and Safari
Steps to Trigger Behavior
map.setBearing
inside of amove
handler whenever the maps bearing does not match the specific valuemove
handler callsmap.setBearing
The same behaviour can be observed with pitch locking but the JSBin does not set that up
Link to Demonstration
https://jsbin.com/posuvohigo/edit?html,output
Expected Behavior
Drag to rotate behaves the same as the compass, allowing you to change the pitch but preventing the bearing from changing
Actual Behavior
Drag to rotate locks up and stops working as soon as you accidentally move the mouse left/right while changing the pitch causing the bearing to change
For further context, we are trying to restrict changing the pitch and/or the bearing as a toggleable setting in our map-viewer. As far as I can find, maplibre has no support for functionality like that. So I have implemented the functionality in a
move
handler, forcing the pitch/bearing to the value it was when it was locked whenever it changes. Works fine with the compass, does not when you try and drag to rotate. In Firefox/Safari the behaviour is much worse than in Chromium based browsers and the map interactions stop working after doing a drag to rotate.The implementation in the JSBin is fundamentally the same as in our map-viewer, just simplified.
The text was updated successfully, but these errors were encountered: