---
title: MapLocationCompass
framework: mapkit
role: symbol
role_heading: Structure
path: mapkit/maplocationcompass
---

# MapLocationCompass

A view that displays a combined user location button and map compass.

## Declaration

```swift
@MainActor @preconcurrency struct MapLocationCompass
```

## Overview

Overview In watchOS 10 and later, this view displays a combined MapUserLocationButton and MapCompass control. When the map camera has a heading of zero (where north is up), this view shows the user location button. When the map camera is in a rotated state, it shows a compass. Use MapLocationCompass in conjunction with Map as a standalone view, as shown in this example:     struct LocationCompassTestView: View {         @Namespace var mapScope

var body: some View {             VStack {                 Map(scope: mapScope)                 MapLocationCompass(scope: mapScope)             }             .mapScope(mapScope)         }     } You can also use MapLocationCompass in conjunction with the mapControls(_:) modifier. For example:     Map()         .mapControls {             MapLocationCompass()         }

## Topics

### Creating a map loction compass

- [init(scope:)](mapkit/maplocationcompass/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)
- [MapPitchSlider](mapkit/mappitchslider.md)
- [MapPitchToggle](mapkit/mappitchtoggle.md)
- [MapScaleView](mapkit/mapscaleview.md)
- [MapUserLocationButton](mapkit/mapuserlocationbutton.md)
- [MapZoomStepper](mapkit/mapzoomstepper.md)
