diff options
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 38f6d2ec65..079e5a8432 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -2996,7 +2996,7 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) if (self.userLocationAnnotationView) { - [self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location]]; + [self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location] animated:animated]; } break; @@ -3013,7 +3013,7 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) if (self.userLocationAnnotationView) { - [self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location]]; + [self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location] animated:animated]; } [self updateHeadingForDeviceOrientation]; @@ -3030,7 +3030,12 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) } } -- (void)locationManager:(__unused CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + [self locationManager:manager didUpdateLocations:locations animated:YES]; +} + +- (void)locationManager:(__unused CLLocationManager *)manager didUpdateLocations:(NSArray *)locations animated:(BOOL)animated { CLLocation *oldLocation = self.userLocation.location; CLLocation *newLocation = locations.lastObject; @@ -3080,7 +3085,7 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) edgePadding:insets zoomLevel:self.zoomLevel direction:course - duration:1 + duration:animated ? 1 : 0 animationTimingFunction:linearFunction completionHandler:NULL]; } @@ -3095,7 +3100,7 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) camera.heading = course; __weak MGLMapView *weakSelf = self; - [self _flyToCamera:camera withDuration:-1 peakAltitude:-1 completionHandler:^{ + [self _flyToCamera:camera withDuration:animated ? -1 : 0 peakAltitude:-1 completionHandler:^{ MGLMapView *strongSelf = weakSelf; strongSelf.userTrackingState = MGLUserTrackingStateChanged; }]; @@ -3113,7 +3118,7 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) camera.altitude = newLocation.horizontalAccuracy; __weak MGLMapView *weakSelf = self; - [self _flyToCamera:camera withDuration:-1 peakAltitude:-1 completionHandler:^{ + [self _flyToCamera:camera withDuration:animated ? -1 : 0 peakAltitude:-1 completionHandler:^{ MGLMapView *strongSelf = weakSelf; strongSelf.userTrackingState = MGLUserTrackingStateChanged; }]; |