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.

Smooth animation in user tracking mode  #3629

Closed

Description

@tobrun

Currently on Android the UserLocationView animates from one location update to another.
You can clearly see the different location updates coming in and the it doesn't seem that the user is traveling at a constant speed. To properly support the idea of implementing navigation, we should streamline location updates/animation.

There are two ways to improve this user experience:

  • Entity interpolation
  • Dead reckoning

On iOS they have chosen to implement Entity interpolation which means that the user dot is actually one step behind the actual location, it is always trying to catch up.

@1ec5 @bleege @zugaldia

Activity

  1. added
    GL JS parity
    Android
    on Jan 20, 2016
  2. added this to the android-v4.0.0 milestone on Jan 20, 2016
  3. 1ec5 commented on Jan 20, 2016

    @1ec5
    Contributor

    On iOS they have chosen to implement Entity interpolation

    #3589 and #1582

  4. bleege commented on Feb 8, 2016

    @bleege
    Contributor

    This is going to be a very useful thing to have. @tobrun do you want to run at this after the dust settles a bit more after MapboxMap was introduced in #3145.

  5. modified the milestone: android-v4.1.0 on Mar 18, 2016
  6. added
    navigation
    on Mar 21, 2016
  7. added this to the android-v4.1.0 milestone on Apr 13, 2016
  8. tobrun commented on Apr 25, 2016

    @tobrun
    MemberAuthor

    The first iteration landed with #4695

    The following items should be resolved to close this issue:

    • While in follow location mode, we are using the the easeTo animate the map under the user location view. The easeTo method uses an easing interpolator and this makes the animation a bit jumpy. Having a linear interpolator variant would resolve this.
    • While in non follow location mode. The user location view is animated with the Android animator framework. The animator framework is time based which makes an animation to have a start and end state. This currently results in a very jumpy animation at high zoom levels, we should probably look in alternative ways of doing this outside the animator framework or write a custom animator from scratch.
  9. 1ec5 commented on Apr 25, 2016

    @1ec5
    Contributor

    The easeTo method uses an easing interpolator and this makes the animation a bit jumpy. Having a linear interpolator variant would resolve this.

    You’ll want to set easing on easeTo()’s optional AnimationOptions parameter. See #3589 for more details.

  10. tobrun commented on Apr 26, 2016

    @tobrun
    MemberAuthor

    @1ec5 thank you for the always helpfull comments 🙇

  11. tobrun commented on Apr 26, 2016

    @tobrun
    MemberAuthor

    I have been looking into adding an own supplied UnitBezier as:

    animationOptions.easing.emplace(mbgl::util::UnitBezier(0, 0, 1, 1));

    Which matches the Linear interpolator found in the Apple docs.

    After adding this it seems the easing interpolation is still there. You can see a clear difference in acceleration at start and deceleration at end. See this clip here.

    @1ec5 any hints on what I'm doing wrong here?

  12. 1ec5 commented on Apr 26, 2016

    @1ec5
    Contributor

    You should just be able to assign the UnitBezier to that field. But I’m not sure why it isn’t working for you regardless. That recording makes it look like the custom easing is being ignored.

  13. tobrun commented on May 26, 2016

    @tobrun
    MemberAuthor

    Revisiting this and this time around I was able to remove interpolation. You can see this in action here. This video was taken on a high zoomlevel were easing used to be very visible.

    FWIW a video at a lower zoomlevel.

  14. tobrun commented on May 26, 2016

    @tobrun
    MemberAuthor

    I'm going to PR the smooth animation for tracking mode separately from the non-tracking. In code these are completely different things and I want to include 49aae67 in the next SNAPSHOT.

  15. tobrun commented on May 26, 2016

    @tobrun
    MemberAuthor

    I was able to get the non-tracking to work as well:

    ezgif com-video-to-gif 25
    ezgif com-video-to-gif 24

  16. tobrun commented on May 26, 2016

    @tobrun
    MemberAuthor

    With above in place, I'm going to cleanup the MyLocationView class a bit and PR it.

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

Metadata

Metadata

Assignees

Labels

AndroidGL JS parityfeaturenavigation

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions