0
我成功實現了MKMapVIew
和我的Map上的單個註釋。我無法同時代表兩個郵筒。我使用MKMapViewDelegate
方法:MKMapView中的兩個註釋引腳
mapView:viewForAnnotation:
有人可以看看這個東西。
謝謝!
編輯
- (void)viewDidLoad
{
[super viewDidLoad];
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 22.569722 ;
region.center.longitude = 88.369722;
region.span.longitudeDelta = 0.1f;
region.span.latitudeDelta = 0.1f;
MKCoordinateRegion anotherRegion = { {0.0, 0.0 }, { 0.0, 0.0 } };
anotherRegion.center.latitude = 28.38 ;
anotherRegion.center.longitude = 77.12;
anotherRegion.span.longitudeDelta = 90.0f;
anotherRegion.span.latitudeDelta = 90.0f;
[mapView setRegion:region animated:YES];
[mapView setDelegate:self];
DisplayMap *ann = [[DisplayMap alloc] init];
ann.title = @" Kolkata";
ann.subtitle = @"Mahatma Gandhi Road";
ann.coordinate = region.center;
[mapView addAnnotation:ann];
DisplayAnotherMap *annMap = [[DisplayAnotherMap alloc] init];
annMap.title = @" New Delhi";
annMap.subtitle = @"Shahdara";
annMap.coordinate = anotherRegion.center;
[mapView addAnnotations:[NSArray arrayWithObjects:annMap,ann,nil]];
}
這將滿足要求爲您服務! ... :)
我已經實例化了MKAnnotation委託類。並在我的mapVIew中添加了註釋。但只有一個對我來說是可見的。我看不到其他。 – turtle 2012-03-20 07:22:41
我使用代碼示例編輯帖子... – 2012-03-20 07:35:17
什麼是MyPlace這裏? .. – turtle 2012-03-20 09:06:33