0
thisコードを使用してMKPointAnnotationに画像を追加しています。ユーザロケーションイメージを変更せずにMKPointAnnotationに画像を追加
- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *SFAnnotationIdentifier = @"SFAnnotationIdentifier";
MKPinAnnotationView *pinView =
(MKPinAnnotationView *)[_routeMap dequeueReusableAnnotationViewWithIdentifier:SFAnnotationIdentifier];
if (!pinView)
{
MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:SFAnnotationIdentifier];
UIImage *flagImage = [UIImage imageNamed:@"BikeIconMap"];
// You may need to resize the image here.
annotationView.image = flagImage;
return annotationView;
}
else
{
pinView.annotation = annotation;
}
return pinView;
}
ただし、ユーザーの場所のカスタム画像も表示しています。ユーザーの場所の円形波アニメーションも消えています。
ユーザの位置の画像やアニメーションを変更することなく、MKPointAnnotationに画像を追加する方法はありますか?