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.

[iOS] desynchro on user annotation #7910

Closed

Description

@RomainQuidet

Platform: iOS 9, 10
**Mapbox SDK version: 3.4.1 **

Steps to trigger behavior

  1. Swipe far away from your location
  2. Set the user tracking mode to follow
  3. Immediately tap on screen to stop the animation

Expected behavior

The map should starts to fly to your location. The tap on screen stops the map and the user location is not visible (as it is far from the bounding box)

Actual behavior

The map starts to fly to the user location. The tap on screen stops the map but the user location is shown on the middle of the map where it should not be. It stays there as long a new location is received.

The bug comes from the user location considered as centered from the start of the action but it is not yet centered before the end of animation.

I don't know yet how to correct that.

Activity

  1. RomainQuidet commented on Jan 31, 2017

    @RomainQuidet
    ContributorAuthor

    One way would to allow tap recognizer to handle the tap if the tracking mode is not none and state is began. This way, the map knows the user stopped the map from scrolling then fall back to tracking state none.
    I can try this solution.

  2. added
    annotations
    iOS
    on Jan 31, 2017
  3. RomainQuidet commented on Jan 31, 2017

    @RomainQuidet
    ContributorAuthor

    I fall in a problem: a touch is detected, the map engine stop the movement and the fly camera completion is called before the tap gesture recognizer is fired. So the fly camera completion does not inform us if the animation completed or has been interrupted by user tap...

  4. RomainQuidet commented on Jan 31, 2017

    @RomainQuidet
    ContributorAuthor

    the completion handler of the MGLMapView.mm method _flyToCamera:::: should have a boolean parameter indicating if the animation fully finish or has been interrupted by the _mbglMap->cancelTransitions() call (from touchBegan:).
    I tried to use only tap recognizer from ObjC level but it seems that the only clean solution is to go deeper into the c++ engine.

  5. RomainQuidet commented on Jan 31, 2017

    @RomainQuidet
    ContributorAuthor

    I succeeded into getting a correct behavior here by adding simples lines before
    _mbglMap->cancelTransitions();

    `- (void)touchesBegan:(__unused NS_SET_OF(UITouch *) *)touches withEvent:(__unused UIEvent *)event
    {
    _changeDelimiterSuppressionDepth = 0;
    _mbglMap->setGestureInProgress(false);
    if (self.userTrackingState == MGLUserTrackingStateBegan)
    {
    [self setUserTrackingMode:MGLUserTrackingModeNone];
    }
    _mbglMap->cancelTransitions();

    }`

    I'm not sure if you like it.

  6. 1ec5 commented on Feb 1, 2017

    @1ec5
    Contributor

    Related to #4781.

  7. eimantas commented on Feb 7, 2017

    @eimantas
    Contributor

    Another one may be to ignore user interaction until animation is complete.

  8. RomainQuidet commented on Feb 7, 2017

    @RomainQuidet
    ContributorAuthor
  9. added this to the ios-v3.6.0 milestone on Mar 28, 2017
  10. fabian-guerra commented on Jun 22, 2017

    @fabian-guerra
    Contributor

    Fixed in #7916

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

Metadata

Metadata

Assignees

Labels

annotationsbugiOS

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions