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.

Swiping downward in perspective makes the map move in the opposite directions (upwards)  #5281

Closed

Description

@mattgraham1

Platform:
Android
Mapbox SDK version:
4.x

Steps to trigger behavior

  1. Download your demo app from the play store
  2. Open a map and put it into perspective mode
  3. Swipe in a downward direction

Expected behavior

Map pans in a downward direction

Actual behavior

Map pans in a upward direction

Activity

  1. added
    Android
    on Jun 8, 2016
  2. friedbunny commented on Jun 9, 2016

    @friedbunny
    Contributor

    @cammace and I couldn’t reproduce this with the current Android demo app on his 5X, though this sounds remarkably similar to the behavior on iOS (#5292).

  3. mattgraham1 commented on Jun 9, 2016

    @mattgraham1
    Author

    I'm able to reproduce it easily on my nexus 6p. Are you trying this in perspective view (two finger swipe up)? Then one finger swipe down will bounce the map up ward. See my attached video (need to unzip first).
    device-2016-06-09-075356.mp4.zip

  4. HeyLookItsBrandon commented on Jun 9, 2016

    @HeyLookItsBrandon

    I've run into this as well on my LG G3. I've found that the map pans as expected when panning slowly. The issue appears to be specific to the fling gesture. When I pan with some velocity and release, the map "bounces" the opposite direction when I lift my finger.

  5. cammace commented on Jun 10, 2016

    @cammace
    Contributor

    After looking more into this, I have been able to reproduce on both 4.0.1 and 4.1.0 betas. This looks to be the same issue happening on iOS @friedbunny linked to.

    2016-06-10 09_47_44

    cc: @zugaldia

  6. 1ec5 commented on Aug 29, 2016

    @1ec5
    Contributor

    This effect reminds me of #3655, which affected untilted maps near the antimeridian. (It was fixed in #4214.)

  7. mdakram commented on Nov 9, 2016

    @mdakram

    It seems its still there in v4.2.0 beta 4.

  8. tobrun commented on Dec 7, 2016

    @tobrun
    Member

    Been debugging this issue in more depth and seeing a couple of scroll gestures occurring before we hit the fling gesture. Both scroll as fling hook into the Transform::moveBy method. The values outputted by the scroll gesture are based around x,y values while the values outputted by the fling gesture are provided as velocityX and velocityY. We now perform some calculations on these velocity values to create a x,y value from it.

    Something I noticed while playing around with these calculations is that if we lower the velocity by dividing it with 6 instead of 4, the issue stops showing but this also results in the fling not feeling like a fling anymore.

    An idea I have been playing around with is taking in account the current tilt value. What I mean by this is that when the map is not tilted the value of 4 remains, when we tilt the map the value will gradually increase.

    Side note here that a related fix provided by @frederoni to handle the horizontal fling issue has made reproducing this a bit harder (related PR in #7105).

  9. tobrun commented on Dec 7, 2016

    @tobrun
    Member

    Without taking tilt in account:

    ezgif com-video-to-gif 7

    With taking tilt in account, and thus lowering velocity based on it:

    • this uses value 7 instead of 4 that was mentioned above.

    ezgif com-video-to-gif 8

  10. tobrun commented on Dec 7, 2016

    @tobrun
    Member

    Next steps to actually resolve the underlying issue, above is just a workaround, is to start writing some core tests to identify where this behaviour is coming from.

    cc @brunoabinader

  11. self-assigned this
    on Dec 12, 2016
  12. added this to the android-v5.0.0 milestone on Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions