diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 7df54ba65..d82bc18f7 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -77,6 +77,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { MBXSettingsMiscellaneousShowReuseQueueStats = 0, MBXSettingsMiscellaneousWorldTour, MBXSettingsMiscellaneousCustomUserDot, + MBXSettingsMiscellaneousShowZoomLevel, MBXSettingsMiscellaneousPrintLogFile, MBXSettingsMiscellaneousDeleteLogFile, }; @@ -113,6 +114,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @property (nonatomic) BOOL customUserLocationAnnnotationEnabled; @property (nonatomic) BOOL usingLocaleBasedCountryLabels; @property (nonatomic) BOOL reuseQueueStatsEnabled; +@property (nonatomic) BOOL showZoomLevelEnabled; @end @@ -153,6 +155,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self restoreState:nil]; self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"]; + self.hudLabel.hidden = YES; if ([MGLAccountManager accessToken].length) @@ -339,11 +342,11 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { ]]; break; case MBXSettingsMiscellaneous: - [settingsTitles addObject:@"Show Reuse Queue Stats"]; - [settingsTitles addObjectsFromArray:@[ + [NSString stringWithFormat:@"%@ Reuse Queue Stats", (_reuseQueueStatsEnabled ? @"Hide" :@"Show")], @"Start World Tour", [NSString stringWithFormat:@"%@ Custom User Dot", (_customUserLocationAnnnotationEnabled ? @"Disable" : @"Enable")], + [NSString stringWithFormat:@"%@ Zoom Level", (_showZoomLevelEnabled ? @"Hide" :@"Show")], ]]; if (self.debugLoggingEnabled) @@ -522,8 +525,16 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { break; case MBXSettingsMiscellaneousShowReuseQueueStats: { - self.reuseQueueStatsEnabled = YES; - self.hudLabel.hidden = NO; + self.reuseQueueStatsEnabled = !self.reuseQueueStatsEnabled; + self.hudLabel.hidden = !self.reuseQueueStatsEnabled; + self.showZoomLevelEnabled = NO; + break; + } + case MBXSettingsMiscellaneousShowZoomLevel: + { + self.showZoomLevelEnabled = !self.showZoomLevelEnabled; + self.hudLabel.hidden = !self.showZoomLevelEnabled; + self.reuseQueueStatsEnabled = NO; break; } default: @@ -1711,7 +1722,15 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { { queuedAnnotations += queue.count; } - self.hudLabel.text = [NSString stringWithFormat:@"Visible: %ld Queued: %ld", (unsigned long)mapView.visibleAnnotations.count, (unsigned long)queuedAnnotations]; + self.hudLabel.text = [NSString stringWithFormat:@" Visible: %ld Queued: %ld", (unsigned long)mapView.visibleAnnotations.count, (unsigned long)queuedAnnotations]; + } else if (self.showZoomLevelEnabled) { + self.hudLabel.text = [NSString stringWithFormat:@" Zoom: %.2f", self.mapView.zoomLevel]; + } +} + +- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated { + if (self.showZoomLevelEnabled) { + self.hudLabel.text = [NSString stringWithFormat:@" Zoom: %.2f", self.mapView.zoomLevel]; } }