Customize MkMapView annotation

I add annotations to MkMapView and use a custom image for this. My custom image is in the shape of a box with a triangular arrow, which should be right in the place that is annotated. MapView seems to annotate by default using the geometric center of the image. What is the best way to develop this problem? Manually moving an icon? Creating an icon in a specific way?

+3
source share
1 answer

Here Apple documents the property MKAnnotationView centerOffset:

By default, the center point of the annotation view is placed at the coordinate point of the associated annotation. You can use this property to reposition the annotation as needed. These x and y offset values ​​are measured in pixels. Positive offset values ​​move the annotation view down and to the right, and negative values ​​move it up and to the left.

+9
source

All Articles