<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.0.0",
    "iPadOS: 14.0.0 - 17.0.0",
    "macCatalyst: -",
    "macOS: 11.0.0 - 14.0.0",
    "tvOS: 14.0.0 - 17.0.0",
    "visionOS: -",
    "watchOS: 7.0.0 - 10.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MapAnnotation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MapKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI0A10AnnotationV"
  },
  "title" : "MapAnnotation"
}
-->

# MapAnnotation

A customizable annotation that marks a map location.

```
struct MapAnnotation<Content> where Content : View
```

## Overview

Use [`MapAnnotation`](/documentation/MapKit/MapAnnotation) to declare the layout of the view that MapKit uses for the annotation. Create a [`Map`](/documentation/MapKit/Map) and display annotations by returning a view that conforms to [`MapAnnotationProtocol`](/documentation/MapKit/MapAnnotationProtocol) from the trailing closure of [`init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)`](/documentation/MapKit/Map/init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)) or [`init(mapRect:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)`](/documentation/MapKit/Map/init(mapRect:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)). Items you provide as a collection to the source  annotations need to conform to <doc://com.apple.documentation/documentation/Swift/Identifiable>.

For example, the following code displays a map and a single annotation:

```swift
struct IdentifiablePlace: Identifiable {
    let id: UUID
    let location: CLLocationCoordinate2D
    init(id: UUID = UUID(), lat: Double, long: Double) {
        self.id = id
        self.location = CLLocationCoordinate2D(
            latitude: lat,
            longitude: long)
    }
}

struct CustomAnnotationMapView: View {
    let place: IdentifiablePlace
    @State var region: MKCoordinateRegion

    var body: some View {
        Map(coordinateRegion: $region,
            annotationItems: [place]
        ) { place in
            MapAnnotation(coordinate: place.location) {
                Rectangle().stroke(Color.blue)
                .frame(width: 20, height: 20)
            }
        }
    }
}
```

## Topics

### Creating a map annotation

[`init(coordinate:anchorPoint:content:)`](/documentation/MapKit/MapAnnotation/init(coordinate:anchorPoint:content:))

Creates a custom annotation that provides a SwiftUI view to display at the map location that you specify.

## Relationships

### Conforms To

[`MapAnnotationProtocol`](/documentation/MapKit/MapAnnotationProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)