Permalink
Browse files

Added method to stop all services and reset mapView to MTLocationManager

  • Loading branch information...
1 parent 206743f commit 12586375efdec651a31ee62a5979ff9cb7bc7daa @myell0w myell0w committed Feb 8, 2011
Showing with 21 additions and 0 deletions.
  1. +2 −0 MTLocationManager.h
  2. +19 −0 MTLocationManager.m
View
@@ -44,4 +44,6 @@
// Singleton Instance
+ (MTLocationManager *)sharedInstance;
+- (void)stopAllServices;
+
@end
View
@@ -46,6 +46,25 @@ - (void)dealloc {
[super dealloc];
}
+////////////////////////////////////////////////////////////////////////
+#pragma mark -
+#pragma mark Location Service Methods
+////////////////////////////////////////////////////////////////////////
+
+- (void)stopAllServices {
+ // Reset transform on map
+ if (self.mapView) {
+ MTClearMapRotation(self.mapView);
+ }
+
+ // stop location-services
+ [self.locationManager stopUpdatingLocation];
+ [self.locationManager stopUpdatingHeading];
+
+ // post notification
+ [[NSNotificationCenter defaultCenter] postNotificationName:kMTLocationManagerDidStopUpdatingHeading object:self userInfo:nil];
+ [[NSNotificationCenter defaultCenter] postNotificationName:kMTLocationManagerDidStopUpdatingServices object:self userInfo:nil];
+}
////////////////////////////////////////////////////////////////////////
#pragma mark -

0 comments on commit 1258637

Please sign in to comment.