I have a list where I display trips and for each trip in the list I am trying to show a rendered map of the trip via my MapTripSnapshotView which works fine on it’s own or initiated directly outside a list but when in a List {…} it does not work. I get the little blue image (see pic) I’m guessing that the list is not waiting for the map to render. How would I go about addressing this so my list items show the rendered map for each list item when the list items are displayed? I am using iOS17 and Map() via MapKit.
List {
ForEach(tripSummariesSD.sorted(by: { $0.originationTimestamp < $1.originationTimestamp }) , id: .self) { trip in
VStack(alignment: .leading) {
Text("Trip: (formatDateStampDayMonthTime(trip.originationTimestamp))")
.fontWeight(.bold)
.padding(.bottom, 1)
VStack(alignment: .leading) {
Text("fr: (trip.originationAddress)")
Text("to: (trip.destinationAddress)")
}
.font(.system(size: 14, design: .monospaced))
MapTripSnapshotView(tripTimestamp: trip.originationTimestamp)
.frame(height: 200)
Any suggestions on how to address would be appreciated.
I outside a list show the MapTripSnapshotView works just fine via say a button click or in a VStack as an item. But when in a list item it doesn’t show. All I get is the blue graphic generated by the system.