---
title: MapCompass
framework: mapkit
role: symbol
role_heading: Structure
path: mapkit/mapcompass
---

# MapCompass

A view that reflects the current orientation of the associated map.

## Declaration

```swift
@MainActor @preconcurrency struct MapCompass
```

## Overview

Overview You can use MapCompass with a Map as a stand alone view, as shown in the following example:     struct CompassButtonTestView: View {         @Namespace var mapScope         var body: some View {         VStack {                 Map(scope: mapScope)                 MapCompass(scope: mapScope)             }             .mapScope(mapScope)         }     } You can also use MapCompass with the Map/mapControls(_:), modifier, as shown below:     Map()         .mapControls {             MapCompass()         } Tapping the compass reorients the map so that North is at the top of the Map view.

## Topics

### Creating a map compass

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

## Relationships

### Conforms To

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

## See Also

### Map controls

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