I have set a custom pinImage for my annotations and when I change the type toMKMapTypeHybrid
it reverts the pinImage setting to the standard pins.
I'm setting the mapType in my viewWillAppear
method of the map view controller. I'm setting my pinImage for the annotations like so (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 there any way to use setImage
and set the mapType via code?