[ios] Add iosapp Show Zoom Level debug option

This commit is contained in:
Jason Wray
2017-02-11 02:39:19 -05:00
committed by Jason Wray
parent 3ec93d3bbe
commit 235a06795a

View File

@@ -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];
}
}