Skip to content

Commit 4c8e140

Browse files
committed
Move traffic setting to map delegate
1 parent c7a47a9 commit 4c8e140

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Mage/MapDelegate.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,10 @@ - (void) setMapView:(MKMapView *)mapView {
404404

405405
- (void) ensureMapLayout {
406406
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
407-
_mapView.mapType = [defaults integerForKey:@"mapType"];
407+
self.mapView.mapType = [defaults integerForKey:@"mapType"];
408+
409+
BOOL showTraffic = [defaults boolForKey:@"mapShowTraffic"];
410+
self.mapView.showsTraffic = showTraffic && self.mapView.mapType != MKMapTypeSatellite;
408411

409412
[self updateCacheOverlaysSynchronized:[[CacheOverlays getInstance] getOverlays]];
410413

Mage/MapViewController.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ - (void) viewWillAppear:(BOOL)animated {
142142
self.mapDelegate.hideLocations = [defaults boolForKey:@"hidePeople"];
143143
self.mapDelegate.hideObservations = [defaults boolForKey:@"hideObservations"];
144144

145-
Boolean showTraffic = [defaults boolForKey:@"mapShowTraffic"];
146-
self.mapView.showsTraffic = showTraffic;
147-
148145
[self setNavBarTitle];
149146

150147
[defaults addObserver:self

0 commit comments

Comments
 (0)