istornz / iPokeGo

A native iOS client to map the Pokemon around you!
https://github.com/RocketMap/RocketMap
MIT License
642 stars 168 forks source link

[Enhancement] Change map type #174

Closed siideffect closed 8 years ago

siideffect commented 8 years ago

Hello, i implemented this feature in a modified version of iPokeGo, to check better pokemon locations, directly by adding a button on mapviewcontroller, and i think it could help (maybe) in some places. With a bool initialized with true in viewDidLoad, you can easily make it working with a logic like this

- (IBAction)mapTypeButton:(id)sender {

    if ( isMapTypeStandard == true ){

        [_mapview setMapType:(MKMapTypeSatellite)];
        isMapTypeStandard = false;
        [_mapTypeButton setTitle:@"Standard" forState: UIControlStateNormal];
    }else{
        [_mapview setMapType:(MKMapTypeStandard)];
        isMapTypeStandard = true;
        [_mapTypeButton setTitle:@"Satellite" forState: UIControlStateNormal];

    }
}

This is just a sample code, but it works greatly.