-
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
Disable drag rotation on NavigationControl compass #9036
Comments
If we do want to remove this functionality, as I see it the next steps would be:
Just to be clear, users would still be able to use the map's default I started work on this (and adding some tests for the navigation control - we currently have none) in the WIP |
This would also nullify #8953 which aimed to ensure that these mouse interactions could also be accessed by the keyboard for accessibility, but if we remove the mouse interaction, then it's no longer an accessibility issue. Coincidentally I also started adding a unit test for navigation control in #8953, but I'll abandon that now if you're working on it. |
Mind you that also happens when interacting with the map canvas -> #4622. |
On mobile I personally use the compass to pitch the map. I didn't find a way to do that with fingers on the map canvas. |
I think removing this probably makes sense for the reasons outlined and because it will clean up a lot of open PRs. Obviously this feature needs some work put into it and it doesn't really seem worth the effort. However, there's a couple of points to note:
|
Hi everyone, thanks for weighing in on this! @andrewharvey I'm not sure that removing this touch interaction is mutually exclusive with your work on keyboard compass controls in #8953 - I'll comment over there so that we can keep that discussion in one place.
Thanks very much for your work on those tests! Definitely do not feel you need to abandon that if you already have more tests written/in progress, it looks like you've written different tests than me so we can just merge them together (e.g. we can merge your tests and then I can resolve the conflicts with mine). If there is any reduplication I'll throw my version out. @pathmapper 👍 Thanks for the answers! Good to know you/your users wouldn't be impacted. @Yanonix Indeed, this (almost accidentally) provides a workaround for the lack of support for the standard two-finger-swipe up/down gesture to control pitch. But as @ryanhamley notes we plan to implement that in an upcoming release, so can I assume that once we have another way to control pitch by touch you would no longer need this functionality on the compass? @ryanhamley re your other point
I'm not convinced this constitutes a semver breaking change as it doesn't break the developer-facing API, but I'm open to being convinced and I do agree we need to decide whether or not it does. Does anyone else have opinions either way? |
Late to the party, but personally:
At least you can disable pitch by setting |
map = new mapboxgl.Map({
dragRotate: false,
touchZoomRotate: true // true to enable pinch zoom, rotation disabled later
})
map.touchZoomRotate.disableRotation() // disable rotation, leaving pinch zoom in tact
map.keyboard.disableRotation()
map.addControl(new mapboxgl.NavigationControl({ showCompass: false })) should work |
Currently, the compass button added by default by a
NavigationControl
allows the user to begin adragRotate
interaction by starting a left-button/single-touch drag within the button div, and then continuing to drag across the map, outside of the button. This is achieved by theNavigationControl
instantiating a newDragRotateHandler
attached to the left-button - by default in addition to the map's ownDragRotateHandler
attached to the right-button.This interaction is:
DragRotateHandler
)I think we should remove this drag-rotate functionality from the compass button, such that the compass control only:
DragRotateHandler
or with calls tosetBearing()
or similar)Questions for the crowd:
cc @ryanhamley @mourner
The text was updated successfully, but these errors were encountered: