Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[iOS] desynchro on user annotation #7910

Closed
RomainQuidet opened this issue Jan 31, 2017 · 8 comments
Closed

[iOS] desynchro on user annotation #7910

RomainQuidet opened this issue Jan 31, 2017 · 8 comments
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS
Milestone

Comments

@RomainQuidet
Copy link
Contributor

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.

@RomainQuidet
Copy link
Contributor Author

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.

@boundsj boundsj added annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS labels Jan 31, 2017
@RomainQuidet
Copy link
Contributor Author

RomainQuidet commented Jan 31, 2017

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...

@RomainQuidet
Copy link
Contributor Author

RomainQuidet commented Jan 31, 2017

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.

@RomainQuidet
Copy link
Contributor Author

RomainQuidet commented Jan 31, 2017

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.

@1ec5
Copy link
Contributor

1ec5 commented Feb 1, 2017

Related to #4781.

@eimantas
Copy link
Contributor

eimantas commented Feb 7, 2017

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

@RomainQuidet
Copy link
Contributor Author

RomainQuidet commented Feb 7, 2017 via email

@fabian-guerra
Copy link
Contributor

Fixed in #7916

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants