tags:

views:

364

answers:

1

I have mapkit view on iphone and i want to show all world in view, but then i use

MKCoordinateRegion region;
region.center.latitude=0.0f;
region.center.longitude=0.0f;
region.span.latitudeDelta=180.0f;
region.span.longitudeDelta=360.0f;
[map setRegion:region];

I have error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Region ' How fix it?

+1  A: 

Have you tried to use "regionThatFits"?

[mapView setRegion:[mapView regionThatFits:region] animated:TRUE];

Marc Puig