From 54d32f90dce85b7d8c26bd36574ee858101d6531 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 31 Jul 2012 10:50:05 -0400 Subject: [PATCH] refs #76: send a dupe heading update after device rotation --- MapView/Map/RMMapView.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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;