diff --git a/MapView/Map/RMMapView.m b/MapView/Map/RMMapView.m index 96598e17c..6fb837a9b 100644 --- a/MapView/Map/RMMapView.m +++ b/MapView/Map/RMMapView.m @@ -253,6 +253,11 @@ - (void)performInitializationWithTilesource:(id )newTilesource name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleDidChangeOrientationNotification:) + name:UIApplicationDidChangeStatusBarOrientationNotification + object:nil]; + RMLog(@"Map initialised. tileSource:%@, minZoom:%f, maxZoom:%f, zoom:%f at {%f,%f}", newTilesource, self.minZoom, self.maxZoom, self.zoom, initialCenterCoordinate.longitude, initialCenterCoordinate.latitude); } @@ -386,6 +391,14 @@ - (void)handleMemoryWarningNotification:(NSNotification *)notification [self didReceiveMemoryWarning]; } +- (void)handleDidChangeOrientationNotification:(NSNotification *)notification +{ + // send a dummy heading update to force re-rotation + // + if (userTrackingMode == RMUserTrackingModeFollowWithHeading) + [self locationManager:locationManager didUpdateHeading:locationManager.heading]; +} + - (NSString *)description { CGRect bounds = self.bounds;