Suppressed an uninitialized value warning from the static analyzer
While tracking the user’s location, a double tap not near the user dot now turns off location tracking instead of bouncing between the tapped location and the user location.
This commit is contained in:
@@ -1077,22 +1077,19 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
|
||||
{
|
||||
CGPoint doubleTapPoint = [doubleTap locationInView:doubleTap.view];
|
||||
|
||||
CGPoint zoomInPoint;
|
||||
|
||||
CGPoint zoomInPoint = doubleTapPoint;
|
||||
CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
|
||||
if (self.userTrackingMode != MGLUserTrackingModeNone)
|
||||
{
|
||||
CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
|
||||
CGRect userLocationRect = CGRectMake(userPoint.x - 40, userPoint.y - 40, 80, 80);
|
||||
if (CGRectContainsPoint(userLocationRect, doubleTapPoint))
|
||||
{
|
||||
zoomInPoint = userPoint;
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( ! CGPointEqualToPoint(zoomInPoint, userPoint))
|
||||
{
|
||||
self.userTrackingMode = MGLUserTrackingModeNone;
|
||||
|
||||
zoomInPoint = doubleTapPoint;
|
||||
}
|
||||
|
||||
_mbglMap->scaleBy(2, zoomInPoint.x, zoomInPoint.y, secondsAsDuration(MGLAnimationDuration));
|
||||
|
||||
Reference in New Issue
Block a user