我正在MapKit
为我的项目使用,到目前为止它一直非常好。这是我用于显示和居中地图的一段代码。
CLLocation *locSouthWest = [[CLLocation alloc] initWithLatitude:southWest.latitude longitude:southWest.longitude];
CLLocation *locNorthEast = [[CLLocation alloc] initWithLatitude:northEast.latitude longitude:northEast.longitude];
CLLocationDistance meters = [locSouthWest distanceFromLocation:locNorthEast];
MKCoordinateRegion region;
region.center.latitude = (southWest.latitude + northEast.latitude) / 2.0;
region.center.longitude = (southWest.longitude + northEast.longitude) / 2.0;
region.span.latitudeDelta = meters / 111319.5;
region.span.longitudeDelta = 0.0;
[self.mapView setRegion:region animated:YES];
问题是,它在 iPhone 4和 iPhone 5上的工作方式不同。
这是iPhone 4(iOS5 和 iOS6 的结果相同):
这是iPhone 5(使用相同的坐标):
有没有人有同样的经历?