我创建了一个自定义的 MKAnnoationView,如下所示:
- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKAnnotationView* customPinView = [[MKAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];
UIImage *pinImage = [PowerPlantAnnotation getAnnotationImageForEnergySource:((PowerPlantAnnotation*)annotation).energySource];
customPinView.image = pinImage;
return customPinView;
}
我得到了我想要或多或少定位在正确位置的图像,但不完全是。我的图像如下所示:
我希望泪滴的底点指向我的注释地图坐标,就像标准引脚视图指向地图坐标一样。我怎样才能做到这一点?目前,它看起来更像是我的图像以地图坐标为中心。