SwiftUI Map Marker monogram replaces its title when Map is embedded in a List

SwiftUI Marker monogram replaces title inside List

Marker(_:monogram:coordinate:) renders incorrectly when the Map is embedded in a List.

Expected:

  • LDN inside the marker pin
  • London below the pin

Actual inside List:

  • LDN appears in the title position
  • London is missing
  • The pin has no monogram

Screenshots

With List — incorrect rendering

Without List — expected rendering

With List

import SwiftUI
import MapKit

struct MapListView: View {
    let position = CLLocationCoordinate2D(
        latitude: 51.5074,
        longitude: -0.1278
    )

    var body: some View {
        List {
            Map(
                initialPosition: .region(
                    MKCoordinateRegion(
                        center: position,
                        span: .init(
                            latitudeDelta: 0.2,
                            longitudeDelta: 0.2
                        )
                    )
                )
            ) {
                Marker(
                    "London",
                    monogram: Text("LDN"),
                    coordinate: position
                )
            }
            .frame(height: 260)
        }
    }
}

Without List

struct MapView: View {
    let position = CLLocationCoordinate2D(
        latitude: 51.5074,
        longitude: -0.1278
    )

    var body: some View {
        Map(
            initialPosition: .region(
                MKCoordinateRegion(
                    center: position,
                    span: .init(
                        latitudeDelta: 0.2,
                        longitudeDelta: 0.2
                    )
                )
            )
        ) {
            Marker(
                "London",
                monogram: Text("LDN"),
                coordinate: position
            )
        }
        .frame(height: 260)
    }
}

The marker renders correctly when the Map is not inside a List.

Is this a known SwiftUI or MapKit bug?

SwiftUI Map Marker monogram replaces its title when Map is embedded in a List
 
 
Q