How can I get the MKMarkerAnnotationView image?
Asked Answered
S

0

6

I have created a map image using the MKMapSnapshotter. Unfortunately the snapshotter does not let you add annotations so I would like to add my annotation directly onto the view.

I know for a pin you can do the following get the UIImage of the pin:

let pinView = MKPinAnnotationView(annotation: nil, reuseIdentifier: nil)
let pinImage = pinView.image

This works fine. However I want the image of the marker. I have tried the following but unfortunately nothing appears.

let markerView = MKMarkerAnnotationView(annotation: nil, reuseIdentifier: nil)
let markerImage = markerView.image

I have changed image to glyphImage and no difference. Is there anyway to get the marker image?

Stroll answered 1/11, 2021 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.