Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Make double-tap-drag work like it does in Google Maps #1319

Closed
2 tasks
1ec5 opened this issue Apr 21, 2015 · 10 comments
Closed
2 tasks

Make double-tap-drag work like it does in Google Maps #1319

1ec5 opened this issue Apr 21, 2015 · 10 comments
Labels
iOS Mapbox Maps SDK for iOS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Apr 21, 2015

When I showed #1292 to @heyitsgarrett, the first thing he tried was a double-tap-drag gesture that allows you to zoom the map in and out with one finger. MKMapView doesn’t support this gesture, but Google Maps does. To my surprise, so does MGLMapView, apparently as a side effect of #1296. Unfortunately, our behavior isn’t quite the same as Google’s, and the differences are unintuitive:

  • We only recognize the gesture if you double-tap, hold, then drag vertically – Google Maps doesn’t require a hold
  • Dragging upwards zooms in while dragging downwards zooms out – the opposite of Google Maps
@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label Apr 21, 2015
@friedbunny
Copy link
Contributor

Hrm, I seem to recall reading that this intentionally added by @incanus. Either way, I like the feature but it does lack discoverability (e.g., I had no idea Google Maps had this). Agree that the additional hold is unnecessary from a usability standpoint, Goog's feels good to me

@ajashton
Copy link
Member

it does lack discoverability

On the Android side of things this is more common/known I think. Nearly all Google apps have it as an alternate gesture to pinch-zooming (photos, email, chrome, docs).

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 22, 2015

Yes, this is a Googleism – a handy one, because you can zoom out with one finger. I was surprised to see it half-work in here; we should either recognize it the way Google Maps users expect or not support it at all.

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 22, 2015

Hrm, I seem to recall reading that this intentionally added by @incanus.

Indeed, it was implemented as a UILongPressGestureRecognizer requiring one tap and a quarter-second hold in cutting-room-floor/mapbox-gl-cocoa@86e9aad. We could nix or reduce the required hold duration, though that might introduce ambiguity with other gesture recognizers.

@incanus
Copy link
Contributor

incanus commented Apr 22, 2015

Yeah, I carried this over from our iOS SDK: mapbox/DEPRECATED-mapbox-ios-sdk#184

I think a long press gesture which requires two taps should be fine. We can nix the delay. We don't otherwise use the double-tap so I don't think it will interfere or will be easily resolved. It'll still be a long press, though, because combining a tap and a drag is tricky otherwise.

@incanus
Copy link
Contributor

incanus commented Apr 23, 2015

To be clear, we have enough relatively major gesture tuning going on (#1296, #1292) that we should probably wait on this until b2.

@ljbade
Copy link
Contributor

ljbade commented May 7, 2015

Making a note that any improvements to touch handling on iOS should also be eventually ported to Android in the big clean up needed in #553

@friedbunny
Copy link
Contributor

Fixed back in #2153.

@heyitsgarrett
Copy link

😄

@1ec5
Copy link
Contributor Author

1ec5 commented Sep 10, 2017

Apparently MapKit in iOS 11 introduces a quick-zoom gesture that zooms in while dragging upwards, like how we implemented it originally but unlike Google Maps and our current implementation. Call it natural zooming, if you will. 🤷‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

6 participants