You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Too much friction when flicking (short-distance panning) the map #1266
@lbud showed me today that the way MGLMapView handles panning gestures seems to impede navigation more than MapKit and the Google Maps SDK, as measured by the (very handy!) ease-of-getting-across-town metric. Part of this perception may come from #1258, but we definitely differ from those frameworks in other ways as well.
Here’s the first thing that comes to mind: in Mapbox GL, “flicking” the map doesn’t cause it to travel as far, and it takes a more robust pan gesture to register a flick. Both MapKit and the Google Maps SDK are more sensitive to flicks. The result is that you feel more friction while navigating.
I don’t have a good setup for scientifically comparing our gesture recognition, but in the name of pseudoscience, I positioned an MGLMapView and a MKMapView both so that Twp. Rd. E in Williams Co., OH, is at the bottom at roughly the same zoom level. (This county built roads in a mostly regular grid, numbering north-south roads and lettering east-west roads, surely anticipating this experiment.) In the screen recordings below, 16 downward flicks of roughly the same length and speed sent the MGLMapView north to Co. Rd. I but the MKMapView all the way to SR 34 (which would be J on the grid):
On a device, the same gestures also took the MGLMapView to Co. Rd. I but sent the MKMapView past I-80/90 (roughly O on the grid). Google Maps sped all the way to Co. Rd. S.
It’s important to get this gesture right because it’s probably going to be the most common.
It would be nice to take the values you end up with here and using them for panning on Android too. Flicking is rather broken on Android currently though.
I’m continuing to play with the constants, with an eye towards making the map feel as slippery as a UIScrollView. Unfortunately, making the map slipperier exacerbates our low framerate when panning.
The framerate didn’t turn out to be impacted by 2bc63f7 after all. I was probably seeing minor performance degradation due to increased tile loading from panning farther each time, but it’s pretty smooth overall.
Activity
incanus commentedon Apr 14, 2015
Interesting, I don't use it this way at all, but my gestures are totally influenced by my development!
/cc @mourner, who tweaked our current inertial pan last.
mourner commentedon Apr 14, 2015
@1ec5 can you try fiddling with the
decelerationandeaseparameters here? https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/MGLMapView.mm#L661 E.g. decreasingdecelerationwill make it travel further, and changingeasewill alter the slowdown curve.ljbade commentedon Apr 15, 2015
It would be nice to take the values you end up with here and using them for panning on Android too. Flicking is rather broken on Android currently though.
1ec5 commentedon Apr 15, 2015
I’m continuing to play with the constants, with an eye towards making the map feel as slippery as a
UIScrollView. Unfortunately, making the map slipperier exacerbates our low framerate when panning.Made pan gestures slipperier
1ec5 commentedon Apr 17, 2015
The framerate didn’t turn out to be impacted by 2bc63f7 after all. I was probably seeing minor performance degradation due to increased tile loading from panning farther each time, but it’s pretty smooth overall.