MKMapView maptype not changing?

TheLearner picture TheLearner · Jan 12, 2011 · Viewed 13.7k times · Source

I cannot understand why my MKMapView does not want to change to satellite view. This method is called and case 1 is called I have stepped over it but it simply does not change to satellite type it always changes to standard. It only works when it goes back to Map type. Anyone have any ideas?

- (IBAction)mapSatelliteSegmentControlTapped:(UISegmentedControl *)sender
{
    switch (sender.selectedSegmentIndex)
    {
        case 1: //Satellite 
            self.mapView.mapType = MKMapTypeSatellite;
        default:  //Map 
            self.mapView.mapType = MKMapTypeStandard;
    }
}

Answer

EmptyStack picture EmptyStack · Jan 12, 2011

Your MKMapView is always ready to change to the satellite view. But you are forcing it to be in the standard view.

"You missed the break statement in case 1"