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

Make double-tapping on make zoom in by a factor of 2 on iOS #2784

Closed
1ec5 opened this issue Jun 26, 2016 · 3 comments
Closed

Make double-tapping on make zoom in by a factor of 2 on iOS #2784

1ec5 opened this issue Jun 26, 2016 · 3 comments
Labels
feature 🍏 GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform good first issue

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 26, 2016

In WebKit on iOS, double-tapping the map zooms in by a very small amount, probably a factor of 1.1. Double-tapping should zoom in by a factor of 2, for consistency with double-clicks in desktop browsers and double-taps in the Mapbox iOS SDK.

Reproduced in v0.19.1 in Safari on iOS 9.3.

/cc @lucaswoj

@kristfal
Copy link

I think this may be a bug. It was working as intended (zooming by a factor of 2) before – but now, you'll need to double-tap and hold on the last tap for the map movement to continue zooming by a factor of 2.

@lucaswoj lucaswoj changed the title Double tap on iOS zooms by very small amount Make double-tapping on make zoom in by a factor of 2 on iOS Jul 29, 2016
@1ec5 1ec5 added the GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform label Feb 15, 2017
@mgd722
Copy link

mgd722 commented Jul 9, 2017

Any workaround for this? Still a thing in Chrome on iOS using v0.36.0

@aparajita
Copy link
Contributor

aparajita commented Sep 12, 2017

I put some logging in all of the event handlers, and this is what happens on iOS Safari when I double-tap:

double click handler
map touchend
drag pan touchend
drag pan up
map mousemove
drag rotate down
drag pan down
map mousedown (this calls map.stop(), killing the zoom)
map mouseup
drag pan mouseup
drag pan up
map click
zoomend

When I commented out the map.stop() call in the map mousedown handler, the zoom worked correctly.

Some policy decisions have to be made by the maintainers. Currently, any zoom or pan can be canceled by a click. The simplest solution would be to set a flag in the double click handler that the map mousedown handler checks, and if the flag is set, the map mousedown handler doesn't call map.stop(). It may be preferable to ignore the mousedown completely during a zoom, so that user map event listeners don't get the mousedown.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 GL native → GL JS For feature parity with Mapbox Maps SDK on a native platform good first issue
Projects
None yet
Development

No branches or pull requests

5 participants