Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Closed

Description

@1ec5

@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):

mapbox mapkit

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.

Activity

  1. added
    iOS
    performance
    on Apr 14, 2015
  2. incanus commented on Apr 14, 2015

    @incanus
    Contributor

    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.

  3. mourner commented on Apr 14, 2015

    @mourner
    Member

    @1ec5 can you try fiddling with the deceleration and ease parameters here? https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/MGLMapView.mm#L661 E.g. decreasing deceleration will make it travel further, and changing ease will alter the slowdown curve.

  4. ljbade commented on Apr 15, 2015

    @ljbade
    Contributor

    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.

  5. self-assigned this
    on Apr 15, 2015
  6. 1ec5 commented on Apr 15, 2015

    @1ec5
    ContributorAuthor

    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.

  7. added a commit that references this issue on Apr 17, 2015
    2bc63f7
  8. 1ec5 commented on Apr 17, 2015

    @1ec5
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSperformance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions