summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r--platform/ios/src/MGLMapView.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 7cebd57710..17c92c8a7d 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -108,6 +108,8 @@ typedef NS_ENUM(NSUInteger, MGLUserTrackingState) {
MGLUserTrackingStateBeginSignificantTransition,
/// The map view has finished moving to the first reported user location.
MGLUserTrackingStateChanged,
+
+ MGLUserTrackingStateThreshold,
};
const NSTimeInterval MGLAnimationDuration = 0.3;
@@ -5700,6 +5702,15 @@ public:
{
return;
}
+
+ CGPoint threshold = CGPointMake(20, 20);
+ if (self.userTrackingState != MGLUserTrackingStatePossible
+ && std::abs(currentPoint.x - correctPoint.x) <= threshold.x && std::abs(currentPoint.y - correctPoint.y) <= threshold.y
+ && self.userTrackingMode != MGLUserTrackingModeFollowWithCourse)
+ {
+ self.userTrackingState = MGLUserTrackingStateThreshold;
+ return;
+ }
if (self.userTrackingMode == MGLUserTrackingModeFollowWithCourse
&& CLLocationCoordinate2DIsValid(self.targetCoordinate))
@@ -6549,6 +6560,9 @@ public:
{
userPoint = MGLPointRounded([self convertCoordinate:self.userLocation.coordinate toPointToView:self]);
}
+ if (self.userTrackingState == MGLUserTrackingStateThreshold) {
+ self.userTrackingState = MGLUserTrackingStateChanged;
+ }
if ( ! annotationView.superview)
{