Relative Content

Tag Archive for swiftuimapkit

Select Markers of different types on SwiftUI Map

In the view described in the following code, I would like to be able to select a marker, no matter if the marker is a Place or an Accommodation. Both Place and Accommodation are defined as classes with different fields. Both of them have latitude, and longitude. But I can only make one of them selectable depending on which one I put on this line

Map() not rendering when in a list view

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.