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
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:
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.
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: