https://developer.apple.com/documentation/mapkit/mkgeojsondecoder?changes=__9&language=objc
I am trying to use this decoder to obtain single points form a geojson file. I am able to do this successfully however, when using MapKit for iOS 17+ I am unable to use a ForEach to iterate through these points (stored in an array) and display these on the map as a custom annotation or even a marker.
MapAnnotation(coordinate: point.coordinate) {
VStack {
Image(systemName: "mappin.circle.fill")
.resizable()
.frame(width: 25, height: 25)
.foregroundColor(.purple)
if let title = point.title {
Text(title)
.font(.caption)
.foregroundColor(.purple)
.padding(2)
.background(Color.white.opacity(0.8))
.cornerRadius(3)
}
}
}