<!--
{
  "availability" : [
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MapLocationCompass",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MapKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI0A15LocationCompassV"
  },
  "title" : "MapLocationCompass"
}
-->

# MapLocationCompass

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

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

## Overview

In watchOS 10 and later, this view displays a combined [`MapUserLocationButton`](/documentation/MapKit/MapUserLocationButton) and [`MapCompass`](/documentation/MapKit/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`](/documentation/MapKit/Map) as a standalone view, as shown in this example:

```swift
    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 <doc://com.apple.documentation/documentation/SwiftUI/View/mapControls(_:)> modifier. For example:

```swift
    Map()
        .mapControls {
            MapLocationCompass()
        }
```

## Topics

### Creating a map loction compass

[`init(scope: Namespace.ID?)`](/documentation/MapKit/MapLocationCompass/init(scope:))

Creates a new map location compass with the provided scope.

### Managing map control sizing and visibility

  <doc://com.apple.documentation/documentation/SwiftUI/View/mapControlVisibility(_:)>

  <doc://com.apple.documentation/documentation/SwiftUI/View/mapControls(_:)>

### Setting the namespace Identifier

  <doc://com.apple.documentation/documentation/SwiftUI/View/mapScope(_:)>

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`View`](/documentation/SwiftUI/View)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)