diff --git a/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift b/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift index dabe0d0..eb8a3be 100644 --- a/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift +++ b/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift @@ -69,7 +69,8 @@ extension MapKitViewHost { #endif view = customView } else { - let markerView = self.mapView.dequeueReusableAnnotationView(withIdentifier: "FlutterMarkerAnnotationView", for: annotation) as! MKMarkerAnnotationView + let markerView = self.mapView.dequeueReusableAnnotationView(withIdentifier: "FlutterMarkerAnnotationView", for: annotation) as? MKMarkerAnnotationView + ?? MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: "FlutterMarkerAnnotationView") self.applyMarkerStyle(markerView, annotation.icon) view = markerView }