From 9f5c1a17d1a74cb1d7beba7aae90d69c452ab81d Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 18 Nov 2011 19:43:06 +0300 Subject: [PATCH] Closed #388 - Automatic dismiss for compass calibration dialog --- iphone/Maps/Platform/LocationManager.h | 1 + iphone/Maps/Platform/LocationManager.mm | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/iphone/Maps/Platform/LocationManager.h b/iphone/Maps/Platform/LocationManager.h index a88f496126..53a71dae68 100644 --- a/iphone/Maps/Platform/LocationManager.h +++ b/iphone/Maps/Platform/LocationManager.h @@ -17,6 +17,7 @@ BOOL m_isStarted; BOOL m_reportFirstUpdate; NSMutableSet * m_observers; + BOOL m_isTimerActive; } - (void)start:(id )observer; diff --git a/iphone/Maps/Platform/LocationManager.mm b/iphone/Maps/Platform/LocationManager.mm index c6958d8f0c..9b6bc70582 100644 --- a/iphone/Maps/Platform/LocationManager.mm +++ b/iphone/Maps/Platform/LocationManager.mm @@ -135,9 +135,21 @@ } } +- (void)onTimer:(NSTimer *)timer +{ + [m_locationManager dismissHeadingCalibrationDisplay]; + m_isTimerActive = NO; +} + // Display compass calibration dialog automatically - (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager { + if (!m_isTimerActive) + { + [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(onTimer:) + userInfo:nil repeats:NO]; + m_isTimerActive = YES; + } return YES; }