Skip to content

Commit

Permalink
refs Outdooractive#76: send a dupe heading update after device rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Jul 31, 2012
1 parent 1e98d88 commit 54d32f9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions MapView/Map/RMMapView.m
Expand Up @@ -253,6 +253,11 @@ - (void)performInitializationWithTilesource:(id <RMTileSource>)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);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 54d32f9

Please sign in to comment.