5

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?

alionthego
  • 8,508
  • 9
  • 52
  • 125

0 Answers0