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

Should double-click & hold & scroll up/down work in GL JS? #9053

Closed
tsuz opened this issue Dec 2, 2019 · 7 comments
Closed

Should double-click & hold & scroll up/down work in GL JS? #9053

tsuz opened this issue Dec 2, 2019 · 7 comments

Comments

@tsuz
Copy link
Contributor

tsuz commented Dec 2, 2019

mapbox-gl-js version:

Question

In Android and iOS SDK, there is a feature to "double tap & hold & pan up/down" which allows users to change the zoom level with one finger. In GL JS, this is not implemented although many websites can be viewed on mobile. From the tests, it seems feasible, but is there a reason behind this design?

Links to related documentation

GL JS -> Double click zoom
iOS Docs -> Double Tap Zoom

@kkaefer
Copy link
Member

kkaefer commented Dec 2, 2019

/cc @vakila

@vakila
Copy link

vakila commented Dec 2, 2019

Hi @tsuz , thanks for asking! Yes, this is something we plan to implement in the future, as part of some overall improvements we're making to our touch gesture handling. I don't have an exact timeline for you but stay tuned and you'll see this "quick zoom" interaction supported in an upcoming release.

@tsuz
Copy link
Contributor Author

tsuz commented Dec 2, 2019

@vakila Thanks for the response. Looking forward to this!

@vakila
Copy link

vakila commented Dec 3, 2019

No problem!

Just to be clear, what we're planning to implement is the double-tap-hold-drag-up/down functionality for touch devices (aka "quick zoom" on some platforms) - we don't have any major changes for click/scroll handling planned as we already have scroll-to-zoom functionality for mouse users. (Just in case the issue title, which differs from the issue description, causes any confusion for folks following along.)

@tsuz
Copy link
Contributor Author

tsuz commented Dec 5, 2019

@vakila

Just to be clear, what we're planning to implement is the double-tap-hold-drag-up/down functionality for touch devices (aka "quick zoom" on some platforms)

So, on a touch device, let's say GL JS rendered on Chrome in mobile would be able to perform "double-tap-hold-drag-up/down" functionality? Whereas if you double click and drag up via a mouse, it will not do have the same behavior as the mobile one? If so, how will you be determining one over the other?

@vakila
Copy link

vakila commented Dec 5, 2019

@tsuz Correct. On a touch device users will be able to zoom the map with the single-finger double-tap-hold-drag (quick zoom) gesture, as well as the current two-finger pinch to zoom in/out. Users interacting with the map via a mouse on a desktop browser will have the existing mouse controls, which include double-click to zoom in, and scroll to zoom in/out. We don't have any plans to implement an additional double-click-hold-drag mouse interaction; to my knowledge that's not a common interaction supported by other maps, nor something users have come to expect or ask for.

how will you be determining one over the other?

Essentially the same way we do already: Events coming from the mouse vs. touch are of different types, so we can detect what type of interaction it is and react appropriately. A given handler might respond to only one type of event (as with the TouchZoomHandler or KeyboardHandler for example) or a handler might listen to multiple types of events and react appropriately based on the event type (as in the DragPanHandler for example).

@ansis ansis mentioned this issue Apr 7, 2020
17 tasks
@ansis
Copy link
Contributor

ansis commented Apr 7, 2020

This gesture has been implemented by #9365. If you have a chance to test and confirm, that would be great! The gesture is in master and will be released in a beta release tomorrow.

@ansis ansis closed this as completed Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants