Reputation: 199
I'm using a custom image for MapKit annotations using :
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {}
The "pin" shows with the right image now when I add a new annotation to my map, but it seems to use the horizontal and vertical centre of the image as the pin point. Is it possible to make this the bottom centre of the image? I could create a new image thats double the hight with the bottom being blank, but was hoping I could do this programmatically Thanks
Upvotes: 3
Views: 1701
Reputation: 11712
anchorPoint
for iOS 16+ only - relative values from 0 to 1centerOffset
for earlier iOS versions - absolutely values, depends on image sizeUpvotes: 0