Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Round tap-zoom gestures to nearest integer #8027

Merged
merged 4 commits into from
Feb 13, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ios] Add iosapp Show Zoom Level debug option
  • Loading branch information
friedbunny committed Feb 11, 2017
commit 74b190194ccdf1811790d2f86ae5b80e278360d7
29 changes: 24 additions & 5 deletions platform/ios/app/MBXViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
MBXSettingsMiscellaneousShowReuseQueueStats = 0,
MBXSettingsMiscellaneousWorldTour,
MBXSettingsMiscellaneousCustomUserDot,
MBXSettingsMiscellaneousShowZoomLevel,
MBXSettingsMiscellaneousPrintLogFile,
MBXSettingsMiscellaneousDeleteLogFile,
};
Expand Down Expand Up @@ -113,6 +114,7 @@ @interface MBXViewController () <UITableViewDelegate,
@property (nonatomic) BOOL customUserLocationAnnnotationEnabled;
@property (nonatomic) BOOL usingLocaleBasedCountryLabels;
@property (nonatomic) BOOL reuseQueueStatsEnabled;
@property (nonatomic) BOOL showZoomLevelEnabled;

@end

Expand Down Expand Up @@ -153,6 +155,7 @@ - (void)viewDidLoad
[self restoreState:nil];

self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"];

self.hudLabel.hidden = YES;

if ([MGLAccountManager accessToken].length)
Expand Down Expand Up @@ -339,11 +342,11 @@ - (void)dismissSettings:(__unused id)sender
]];
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)
Expand Down Expand Up @@ -522,8 +525,16 @@ - (void)performActionForSettingAtIndexPath:(NSIndexPath *)indexPath
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:
Expand Down Expand Up @@ -1711,7 +1722,15 @@ - (void)mapViewRegionIsChanging:(MGLMapView *)mapView
{
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];
}
}

Expand Down