Contents

init(item:anchor:accessoryAnchor:content:)

Creates an annotation that displays a view at a coordinate on the map.

Declaration

@MainActor @preconcurrency init(item: MKMapItem, anchor: UnitPoint = .center, accessoryAnchor: UnitPoint = .center, @ViewBuilder content: () -> Content) where Label == Text

Parameters

  • item:

    A map item that provides a label and coordinate for the annotation.

  • anchor:

    A Unitpoint value that indicates how to position the content around the provided coordinate.

  • accessoryAnchor:

    A Unitpoint value that indicates how to place accessories around the provided content.

  • content:

    The view to place on the map.

See Also

Creating annotations