Skip to content

Instantly share code, notes, and snippets.

@Morse-Code
Created April 29, 2013 03:03
Show Gist options
  • Save Morse-Code/5479479 to your computer and use it in GitHub Desktop.
Save Morse-Code/5479479 to your computer and use it in GitHub Desktop.
MapKit map type three way toggle.
- (IBAction)toggleMapType:(id)sender
{
NSLog(@"toggleMapType");
mapType = (mapType + 1) % 3;
if (mapType == 0) {
self.dangerMap.mapType = MKMapTypeStandard;
}
else if (mapType == 1) {
self.dangerMap.mapType = MKMapTypeHybrid;
}
else if (mapType == 2) {
self.dangerMap.mapType = MKMapTypeSatellite;
}
else
{
self.dangerMap.mapType = MKMapTypeStandard;
mapType = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment