Search code examples
objective-ciosmapkitmkcoordinateregion

Is MKCoordinateRegion span center to boundary or boundary to boundary?


Does the span for MKCoordinateRegion represent the distance from the center to each boundary or the distance from boundary to boundary?

If I want to calculate the boundaries of the region to I add/subtract the span from the center or do I need to /2?

lowerLatitude=center-span.latitudeDelta or lowerLatitude=center-(span.latitudeDelta/2)


Solution

  • Running this code:

    self.mapView.region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(0.0, 0.0), MKCoordinateSpanMake(23.5, 10.0));

    I was able to see as far north as the border of the Western Sahara, and as far south as the Etosha National Park; as far west as the west cosast of Senegal; and as far east as N'Djamena.

    Based on that, and a little time with Google Maps, it appears that the span is a total of 47 degrees north-south, and 20 degrees west-east.