Я хочу показать изображение в MKMapView
вместо маленького булава. Может кто-нибудь, пожалуйста, поместите здесь полезный код или расскажите, как это сделать?
Спасибо!
ИЗМЕНИТЬ
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:
(id <MKAnnotation>)annotation {
MKPinAnnotationView *pinView = nil;
if(annotation != mapView.userLocation)
{
static NSString *defaultPinID = @"com.invasivecode.pin";
pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil ) pinView = [[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:defaultPinID];
pinView.pinColor = MKPinAnnotationColorGreen;
pinView.canShowCallout = YES;
pinView.animatesDrop = YES;
pinView.image = [UIImage imageNamed:@"pinks.jpg"]; //as suggested by Squatch
}
else {
[mapView.userLocation setTitle:@"I am here"];
}
return pinView;
}
Я ожидаю, что мое изображение pinks.jpg будет на карте, привязывая место вместо стандартного вида булавки (рок-булавка). Но все же я получаю изображение вывода по умолчанию.