Hi all,
I am working on a map application in iPhone. While loading the MapViewController the map is not loaded automatically in the mapView, When we drag the mapView the area outside the intial view is loaded. Also when we double tap on the map it get start loading. Can anybody help me fixing this.?
Thanks in Advance,
Shibin
From stackoverflow
-
Try putting the next lines in the
viewDidLoadof the view controller:CLLocation *location;// Get the location from location manager if (location) { MKCoordinateRegion region = MKCoordinateRegionMake(location.coordinate, MKCoordinateSpanMake(0.02, 0.02)); [self.mapView setRegion:region animated:TRUE]; [self.mapView regionThatFits:region]; }Shibin Moideen : Thanks Michael, It works.
0 comments:
Post a Comment