I set a custom pinImage for my annotations, and when I change the type to MKMapTypeHybrid, it returns the pinImage setting to the standard pins.
I install mapType in my viewWillAppearmap display controller method . I set my pinImage for annotations like this (shortened for clarity):
- (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id ) annotation {
MKPinAnnotationView *customAnnotationView=[[[MKPinAnnotationView alloc]
initWithAnnotation:annotation
reuseIdentifier:@"markerAnnotationView"] autorelease];
UIImage *pinImage = [UIImage imageNamed:@"/pin-image"];
[customAnnotationView setImage:pinImage];
return customAnnotationView;
}
Is it possible to use setImageand install mapType through code?
source
share