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

Slip and slide #1292

Merged
merged 9 commits into from
May 1, 2015
Merged

Slip and slide #1292

merged 9 commits into from
May 1, 2015

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Apr 17, 2015

On the perceived performance front, we’ve made the map feel far too “heavy” when it comes to gestures. Our gesture recognition impacts the map’s responsiveness pretty heavily. So here’s what I’d like to do to make the map have the same slippery feel as UIScrollView:

After a flick of the finger, MGLMapView now drifts much more naturally than before. It’s just ever-so-slightly more aggressive than MKMapView but still a lot less aggressive than Google Maps.

/cc @mourner @incanus

Replaced the complex formula for overpanning with a simple one that makes the map feel much slipperier than before. `MGLMapView` now overpans just a little more aggressively than `MKMapView` but still a lot less aggressively than Google Maps.

Fixes #1266.
@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage 2 - Working labels Apr 17, 2015
@1ec5 1ec5 added this to the iOS Beta 1 milestone Apr 17, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 17, 2015

Currently working on getting the zoom animation right. There are apparently edge cases that cause the map to zoom out to NaN and get all wonky.

When the panning velocity is low enough, ignore the pan gesture to simulate friction on the device’s glass screen.
Apply a subtle animated zoom after a pinch gesture completes. Lots of magic numbers involved. Avoid drifting when the pinch is near-static, and when the scale factor would go below the minimum. There is more resistance to pinching outward than pinching inward, because it’s far easier to lose your place when you accidentally zoom out. Disabled two-finger pan, which is typically reserved for changing pitch; otherwise, it’s easy to accidentally pan while intending to pinch.
fmodf() would conflict with the fix for #1199.
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 19, 2015

33aeece makes it really easy to hit #1199, so #1295 should be applied in conjunction with this PR.

@1ec5 1ec5 changed the title [WIP] Slip and slide Slip and slide Apr 19, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 19, 2015

2bc63f7 makes #1258 that much more aggravating, so #1296 should also be applied in conjunction with this PR.

It’s pretty darn hard to get up to 5 rad/s with the same two fingers.
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 20, 2015

Ginormous before and after screen recordings, courtesy of the good citizens of Knockemstiff and Wapakoneta.

@mourner
Copy link
Member

mourner commented Apr 22, 2015

👍

@mourner mourner closed this Apr 22, 2015
@mourner mourner reopened this Apr 22, 2015
@incanus
Copy link
Contributor

incanus commented Apr 22, 2015

Gonna check this out a bit.

@incanus
Copy link
Contributor

incanus commented Apr 23, 2015

This feels really awesome. I am seeing the occasional rotation though when trying to pinch zoom out.

@incanus incanus self-assigned this Apr 29, 2015
@incanus
Copy link
Contributor

incanus commented May 1, 2015

Per voice we are going to merge this and iterate.

1ec5 added a commit that referenced this pull request May 1, 2015
@1ec5 1ec5 merged commit 93f6218 into master May 1, 2015
@1ec5 1ec5 deleted the 1266-slippy branch May 1, 2015 04:49
@1ec5
Copy link
Contributor Author

1ec5 commented May 1, 2015

🍌🏃💨

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too much friction when flicking (short-distance panning) the map
3 participants