I have a tappable MapAnnotation
and whenever I try to customize the "look" of the annotation pin, I get the following error:
Initializer 'init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)' requires that 'NavigationLink<PlaceAnnotationView, LocationDetailsView>' conform to 'MapAnnotationProtocol'
Annotation
is defined by this:
struct Annotation: Codable, Identifiable, Hashable {
@DocumentID var id: String?
let lat: String?
let lng: String?
var name: String
}
And the Map is defined by this:
Map(coordinateRegion: $region, annotationItems: annotations) { place in
NavigationLink {
LocationDetailsView(place: place.name)
} label: {
PlaceAnnotationView(title: place.name)
}
}
Have I forgotten to define something? Please let me know. Thanks.