【发布时间】:2012-11-30 15:30:22
【问题描述】:
我创建一个自定义的 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;
}
我得到了我想要或多或少定位在正确位置的图像,但不是完全正确。我的图像如下所示:
我希望泪滴的底点指向我的注释地图坐标,就像标准大头针视图指向地图坐标一样。我怎样才能做到这一点?目前它看起来更像是我的图像以地图坐标为中心。
【问题讨论】:
标签: ios mkannotation mkannotationview mapkit