Created
January 17, 2012 08:51
-
-
Save ebinnion/1625717 to your computer and use it in GitHub Desktop.
Set map region in iOS Mapkit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLLocationCoordinate2D location; | |
location.latitude=yourlatitude; | |
location.longitude=yourlongitude; | |
span.latitudeDelta=0.01; //or whatever zoom level | |
span.longitudeDelta=0.01; | |
region.span=span; | |
region.center=location; | |
[mapview setRegion:region animated:TRUE]; | |
[mapview regionThatFits:region]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MKCoordinateRegion CSC; | |
// Defines the center point of the map | |
CSC.center.latitude = 33.874809; | |
CSC.center.longitude = -98.521129; | |
// Defines the viewable area of the map. Lower numbers zoom in! | |
CSC.span.latitudeDelta = .003; | |
CSC.span.longitudeDelta = .003; | |
[map setRegion:CSC animated:YES]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment