summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent W <bwhtmn@gmail.com>2016-05-10 16:55:00 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-10 16:55:00 -0700
commit348cfaab126e82182f0f67481d282816862139e9 (patch)
tree1048f6d26f826e9253864a4f5b36c30b42bb72f4
parent9c033cf9a3df7f946fcfa56ccf699f5adb5fa7fd (diff)
downloadqtlocation-mapboxgl-348cfaab126e82182f0f67481d282816862139e9.tar.gz
[ios] fix potential for very slow animations of user location dot (#4997)
fix logic error that could cause user location to animate extremely slowly if there is a significant time passing between location updates
-rw-r--r--platform/ios/src/MGLMapView.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 184a3fd5d4..11484a097a 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3774,7 +3774,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
NSTimeInterval duration = MGLAnimationDuration;
if (oldLocation && ! CGPointEqualToPoint(self.userLocationAnnotationView.center, CGPointZero))
{
- duration = MAX([newLocation.timestamp timeIntervalSinceDate:oldLocation.timestamp], MGLUserLocationAnimationDuration);
+ duration = MIN([newLocation.timestamp timeIntervalSinceDate:oldLocation.timestamp], MGLUserLocationAnimationDuration);
}
[self updateUserLocationAnnotationViewAnimatedWithDuration:duration];