I'm attempting to use the MKMapView. I've succeeded in making the world map appear. However, I can't seem to change the region:
I have a button that will perform this:
NSLog(@"%f, %f, %f, %f,
mapView.region.center.latitude,
mapView.region.center.longitude,
mapView.region.span.latitudeDelta,
mapView.region.span.longitudeDelta);
Now, in my viewDidLoad
method, I attempt to set a starting region to view:
CLLocationCoordinate2D startCoord;
startCoord.latitude = 49.0;
startCoord.longitude = -123.0;
[mapView setRegion:MKCoordinateRegionMakeWithDistance(startCoord, 200, 200) animated:YES];
When the view does load, it shows the same world map instead of a smaller area as expected. Immediately logging the region's attributes gives me:
0.000000, 0.001417, 0.000000, 0.000000
Moving the map around a bit, resizing and zooming doesn't change these values (except that the second one goes back to 0.000000).
It would appear to be that mapView.region does not correspond to what I'm seeing on the screen, but I'm quite certain I made the IB links correctly, I'm looking at them right now. What could be the problem?