13
我已延長MapKit的繪製自定義註解圖像用下面的代碼能力:擴展MapView類:viewForAnnotation現在沒有藍點
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
NSLog(@"Drawing a cloud on the map");
MKAnnotationView *view;
if(annotation != mapView.userLocation){
view=[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"parkingloc"];
view.image=[UIImage imageNamed:@"placemarkCloud.png"];
[view setCanShowCallout:YES];
[view setRightCalloutAccessoryView:[UIButton buttonWithType:UIButtonTypeDetailDisclosure]];
}
else{
view=
}
return view;
}
我的問題是什麼,我應該爲了留住iPhone的內置使視圖=到在藍點。您可以看到我消除了爲該點繪製的自定義圖像,但我不知道如何將其顯示爲默認值。