<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/UserAnnotation/init(anchor:content:)-8u3r4",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "MapKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI14UserAnnotationV6anchor7contentACyxG0cD09UnitPointV_xAA0E8LocationVctcfc"
  },
  "title" : "init(anchor:content:)"
}
-->

# init(anchor:content:)

Creates an annotation that displays a person’s current location using the system styled user location indicator with the specified anchor point using a custom view.

```
@MainActor @preconcurrency init(anchor: UnitPoint = .center, @ViewBuilder content: @escaping (UserLocation) -> Content)
```

## Parameters

`anchor`

A UnitPoint value that describes how to anchor the user location indicator to the person’s location. The default is <doc://com.apple.documentation/documentation/SwiftUI/UnitPoint/center>.

`content`

The custom view to show at the person’s location.

## Return Value

Returns  a [`UserAnnotation`](/documentation/MapKit/UserAnnotation) that displays a persons current location using the specified anchor location.

---

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)