0
有沒有辦法讓mkmapview放大顯示所有註釋?我在北美有94個註釋,我不希望用戶必須縮小很多。以下是我的代碼片段:有沒有辦法讓mkmapview放大顯示所有註釋?
- (void)viewDidLoad {
[super viewDidLoad];
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
// Central Alabama Chapter
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 33.45606;
region.center.longitude = -86.83078;
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapView setRegion:region animated:YES];
[mapView setDelegate:self];
DisplayMap *ann = [[DisplayMap alloc] init];
ann.title = @"Central Alabama Chapter";
ann.subtitle = @"721 Hillmoor Lane Homewood, Alabama 35209";
ann.coordinate = region.center;
[mapView addAnnotation:ann];
// Walnut Ridge Fire Department
MKCoordinateRegion region1 = { {0.0, 0.0 }, { 0.0, 0.0 } };
region1.center.latitude = 36.11493;
region1.center.longitude = -90.95695;
region1.span.longitudeDelta = 0.01f;
region1.span.latitudeDelta = 0.01f;
DisplayMap *ann1 = [[DisplayMap alloc] init];
ann1.title = @"Walnut Ridge Fire Department";
ann1.subtitle = @"3217 Highway 67 # B, Walnut Ridge, AR";
ann1.coordinate = region1.center;
[mapView addAnnotation:ann1];