И удаление:

я проблема с подгонкой всех моих аннотаций к экрану ... иногда он показывает все аннотации, но в некоторых случаях приложение масштабирует между двумя аннотациями, чтобы ни одна из них не была видна ... Я хочу, чтобы приложение всегда подгонять регион под аннотации, а не увеличивать масштаб между ними ... что я делаю не так?

if ([mapView.annotations count] == 2) { 
 CLLocationCoordinate2D SouthWest = location;
 CLLocationCoordinate2D NorthEast = savedPosition;

 NorthEast.latitude = MAX(NorthEast.latitude, savedPosition.latitude);
 NorthEast.longitude = MAX(NorthEast.longitude, savedPosition.longitude); 

 SouthWest.latitude = MIN(SouthWest.latitude, location.latitude);
 SouthWest.longitude = MIN(SouthWest.longitude, location.longitude);

 CLLocation *locSouthWest = [[CLLocation alloc] initWithLatitude:SouthWest.latitude longitude:SouthWest.longitude];
 CLLocation *locNorthEast = [[CLLocation alloc] initWithLatitude:NorthEast.latitude longitude:NorthEast.longitude];

 CLLocationDistance meter = [locSouthWest distanceFromLocation:locNorthEast];

 MKCoordinateRegion region;
 region.span.latitudeDelta = meter / 111319.5;
 region.span.longitudeDelta = 0.0;
 region.center.latitude = (SouthWest.latitude + NorthEast.latitude) / 2.0;
 region.center.longitude = (SouthWest.longitude + NorthEast.longitude) / 2.0;

 region = [mapView regionThatFits:region];
 [mapView setRegion:region animated:YES];

 [locSouthWest release];
 [locNorthEast release]; 
}

Есть идеи?

Спасибо!!

Ответы на вопрос(1)

Ваш ответ на вопрос