Reputation: 1944
Is there a way to view a map based on the range of annotations that you have? So that does not leave any pin out
//Map
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 299, 406)];
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = [latitudeNumber doubleValue];
region.center.longitude = [longitudeNumber doubleValue];
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapView setRegion:region animated:YES];
[mapView setDelegate:self];
[self.view addSubview:mapView];
Thanks!
Upvotes: 0
Views: 449
Reputation: 2039
See this post: Positioning MKMapView to show multiple annotations at once
Depending on how many annotations you're adding, you may have to tweak the code found in the linked answer to loop through all of your annotations to find the min/max values of lat/long.
Upvotes: 1