<!--
{
  "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/MapMarker",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MapKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI0A6MarkerV"
  },
  "title" : "MapMarker"
}
-->

# MapMarker

A balloon-shaped annotation used to indicate the location on a map.

```
struct MapMarker
```

## Overview

Create a [`Map`](/documentation/MapKit/Map) and display marker annotations by returning a view that conforms to [`MapAnnotationProtocol`](/documentation/MapKit/MapAnnotationProtocol), such as [`MapMarker`](/documentation/MapKit/MapMarker), 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 with a marker 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 PinAnnotationMapView: View {
    let place: IdentifiablePlace
    @State var region: MKCoordinateRegion

    var body: some View {
        Map(coordinateRegion: $region,
            annotationItems: [place])
        { place in
            MapMarker(coordinate: place.location,
                   tint: Color.purple)
        }
    }
}
```

## Topics

### Creating a map marker

[`init(coordinate:tint:)`](/documentation/MapKit/MapMarker/init(coordinate:tint:))

Creates a marker annotation at the map location you specify.



---

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)