Skip to content
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

cooperativeGestures combined with dragRotation set to disabled creates odd UX behavior #4683

Open
MikaelPorttila opened this issue Sep 9, 2024 · 1 comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed

Comments

@MikaelPorttila
Copy link

MikaelPorttila commented Sep 9, 2024

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)

  1. Zoom in
  2. Try To adjust position by dragging
  3. Nothing happens
  4. 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. 🚀

@HarelM
Copy link
Collaborator

HarelM commented Sep 9, 2024

This is probably an unintended behavior, cooperative gestures is probably still not fully battle tested.
Feel free to submit a PR to solve this.

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants