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

Commit

Permalink
refs #1125, 1813: update user dot tracking in one place
Browse files Browse the repository at this point in the history
Now that we have cleanup around the map viewport change notifications,
this only needs to happen in one place: the GL frame draw loop.
  • Loading branch information
incanus committed Jul 8, 2015
1 parent fb230dd commit ed04e6d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions platform/ios/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ - (void)glkView:(__unused GLKView *)view drawInRect:(__unused CGRect)rect
_mbglMap->setSourceTileCacheSize(cacheSize);

_mbglMap->renderSync();

[self updateUserLocationAnnotationView];
}
}

Expand Down Expand Up @@ -2351,8 +2353,6 @@ - (void)locationManager:(__unused CLLocationManager *)manager didUpdateToLocatio

self.userLocationAnnotationView.haloLayer.hidden = ! CLLocationCoordinate2DIsValid(self.userLocation.coordinate) ||
newLocation.horizontalAccuracy > 10;

[self updateUserLocationAnnotationView];
}

- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager
Expand Down Expand Up @@ -2509,8 +2509,6 @@ - (void)notifyMapChange:(mbgl::MapChange)change
case mbgl::MapChangeRegionWillChange:
case mbgl::MapChangeRegionWillChangeAnimated:
{
[self updateUserLocationAnnotationView];

[self deselectAnnotation:self.selectedAnnotation animated:NO];

BOOL animated = (change == mbgl::MapChangeRegionWillChangeAnimated);
Expand Down Expand Up @@ -2545,7 +2543,6 @@ - (void)notifyMapChange:(mbgl::MapChange)change
}
case mbgl::MapChangeRegionIsChanging:
{
[self updateUserLocationAnnotationView];
[self updateCompass];

if ([self.delegate respondsToSelector:@selector(mapViewRegionIsChanging:)])
Expand All @@ -2557,7 +2554,6 @@ - (void)notifyMapChange:(mbgl::MapChange)change
case mbgl::MapChangeRegionDidChange:
case mbgl::MapChangeRegionDidChangeAnimated:
{
[self updateUserLocationAnnotationView];
[self updateCompass];

if (self.pan.state == UIGestureRecognizerStateChanged ||
Expand Down

0 comments on commit ed04e6d

Please sign in to comment.