---
title: MapUserLocationButton
framework: mapkit
role: symbol
role_heading: Structure
path: mapkit/mapuserlocationbutton
---

# MapUserLocationButton

A button that sets the framing of the associated map to the user location.

## Declaration

```swift
@MainActor @preconcurrency struct MapUserLocationButton
```

## Overview

Overview Use MapUserLocationButton in conjunction with Map as a stand alone view, as shown in this example:     struct LocationButtonTestView: View {         @Namespace var mapScope         var body: some View {             VStack {                 Map(scope: mapScope)                 MapUserLocationButton(scope: mapScope)             }             .mapScope(mapScope)         }     } You can also use MapUserLocationButton in conjunction with the Map/mapControls(_:) modifier as shown in this example:     Map()         .mapControls {             MapUserLocationButton()         }

## Topics

### Creating a map user location button

- [init(scope:)](mapkit/mapuserlocationbutton/init(scope:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [View](swiftui/view.md)

## See Also

### Map controls

- [MapCompass](mapkit/mapcompass.md)
- [MapLocationCompass](mapkit/maplocationcompass.md)
- [MapPitchSlider](mapkit/mappitchslider.md)
- [MapPitchToggle](mapkit/mappitchtoggle.md)
- [MapScaleView](mapkit/mapscaleview.md)
- [MapZoomStepper](mapkit/mapzoomstepper.md)
