maplibre-gl-js
maplibre-gl-js copied to clipboard
cooperativeGestures combined with dragRotation set to disabled creates odd UX behavior
Hi,
While trying to make MapLibre behave somewhat like Google Maps by using the built-in setting cooperativeGestures and dragRotation set to disabled, I noticed this odd behavior where an user has to release CTRL to enable drag-navigation after the CTRL+scroll zoom unlike Google Maps where the user can continue dragging while CTRL is pressed.
Could it be that I have to disable more map features to prevent CTRL from blocking drag? Or is this an unintended behavior? Looking at the project history the cooperativeGestures was designed to mimic the Google Maps behavior, could it be that no one has tried to combine it with dragRotation disabled?
I hope there was some clarity in what I'm trying to achieve, I have provided jsfiddles for both the current MapLibre behavior and the "target" Google Map behavior.
maplibre-gl-js version: 4.7.0
browser: Any desktop browser will do, lets say Microsoft Edge
Steps to Trigger Behavior
(Using provided jsfiddle link)
- Zoom in
- Try To adjust position by dragging
- Nothing happens
- Realize you have to release CTRL to enable the drag-navigation
Link to Demonstration
MapLibre behavior: https://jsfiddle.net/ecodot/o54kuqad/11/ Google Maps for comparison: https://jsfiddle.net/user2314737/x4gM4/
Expected Behavior
While cooperativeGestures set to true, rotation is set to disabled and the user press CTRL, no blocking drag should be done.
Actual Behavior
Dragging is blocked even though rotation is disabled and the user press CTRL.
This will hopefully help others coming from Google Maps and Leaflet aswell. 🚀