<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MapPitchToggle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MapKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI0A11PitchToggleV"
  },
  "title" : "MapPitchToggle"
}
-->

# MapPitchToggle

A button that sets the pitch of the associated map.

```
@MainActor @preconcurrency struct MapPitchToggle
```

## Overview

The `MapPitchToggle` control sets the pitch of the associated map to a pleasing angle if flat, or returns the map to flat if pitched.

You can use this control in conjunction with [`Map`](/documentation/MapKit/Map) as a standalone view, as this example shows:

```swift
    struct MyMapView: View {
        @Namespace var mapScope

        var body: some View {
            VStack {
                Map(scope: mapScope)
                MapPitchToggle(scope: mapScope)
            }
            .mapScope(mapScope)
        }
    }
```

Alternatively, use `MapPitchToggle` in conjunction with the <doc://com.apple.documentation/documentation/SwiftUI/View/mapControls(_:)> modifier. For example:

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

## Topics

### Creating a map pitch toggle

[`init(scope:)`](/documentation/MapKit/MapPitchToggle/init(scope:))

Creates a new map pitch toggle control 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(_:)>

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

### Setting the namespace Identifier

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

## Relationships

### Conforms To

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

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

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

---

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)