Skip to content

Commit

Permalink
Update when tracking/map recentering is handled. #968
Browse files Browse the repository at this point in the history
  • Loading branch information
bskinner committed May 14, 2015
1 parent dd14afe commit fa918f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Modules/Mobius/MITMobiusMapViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
}
}

- (void)mapView:(MKMapView *)mapView didChangeUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated
{
if (mode == MKUserTrackingModeNone) {
self.mapView.showsUserLocation = NO;
} else {
self.mapView.showsUserLocation = YES;
}
}

#pragma mark - Custom Callout

- (void)presentCalloutForMapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ - (void)viewWillAppear:(BOOL)animated
} else {
[self.navigationController setToolbarHidden:YES animated:animated];
}

self.mapViewController.mapView.userTrackingMode = MKUserTrackingModeNone;
[self.mapViewController recenterOnVisibleResources:animated];
}

- (void)didReceiveMemoryWarning {
Expand Down Expand Up @@ -384,6 +387,7 @@ - (void)setMapFullScreen:(BOOL)mapFullScreen animated:(BOOL)animated
} completion:^(BOOL finished) {
self.fullScreenMapGesture.enabled = YES;
self.mapViewContainer.userInteractionEnabled = NO;
self.mapViewController.mapView.userTrackingMode = MKUserTrackingModeNone;

[self.mapViewController recenterOnVisibleResources:animated];
[self.navigationController setToolbarHidden:YES animated:animated];
Expand Down

0 comments on commit fa918f0

Please sign in to comment.