views:

105

answers:

1

I am new to iphone development.I am creating a map application.I want to load the map with a desired location with desired type and zoom.I am able to load the map at desired location by setting the coordinates.i want the zoom to be 18 and the map type to hybrid.

- (void)viewDidLoad {
MKCoordinateRegion region;
region.center.latitude=31.825;
region.center.longitude=-31.402;
region.span.latitudeDelta=0.001;
region.span.longitudeDelta=0.0054;

mapView.region=region;

}

How to achieve it .Please help me out.Thanks.

+1  A: 

MKMapView does not work with zoom levels. It uses regions instead. But judging from your code, you have already discovered that. What exactly is it that doesn't work in your code? It looks correct.

For a hybrid map:

mapView.mapType = MKMapTypeHybrid;
Ole Begemann
Thanks , how can i implement the zoom?any idea.I saw this tutorial http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/... but i cant understand it
Warrior
Well, the code you linked to is useful if you really must work with zoom levels. Just add the two files to your project, import the .h file in your view controller's .m file and use `[mapView setCenterCoordinate:zoomLevel:animated:]` instead of setting the region.
Ole Begemann
Thanks for the help...
Warrior