---
title: "init(anchor:content:)"
framework: mapkit
role: symbol
role_heading: Initializer
path: "mapkit/userannotation/init(anchor:content:)-8u3r4"
---

# 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.

## Declaration

```swift
@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

Return Value Returns  a UserAnnotation that displays a persons current location using the specified anchor location.

## See Also

### Creating a user annotation

- [init()](mapkit/userannotation/init().md)
- [init(anchor:)](mapkit/userannotation/init(anchor:).md)
- [init(anchor:content:)](mapkit/userannotation/init(anchor:content:)-3e78j.md)
