---
title: MapScaleView
framework: mapkit
role: symbol
role_heading: Structure
path: mapkit/mapscaleview
---

# MapScaleView

Displays a legend with distance information for the associated map.

## Declaration

```swift
@MainActor @preconcurrency struct MapScaleView
```

## Overview

Overview You can use this with Map as a standalone view, for example:     struct ScaleTestView: View {         @Namespace var mapScope

var body: some View {             VStack {                 Map(scope: mapScope)                 MapCompass(scope: mapScope)             }             .mapScope(mapScope)         }     } The scale indicator grows and shrinks (although visually, its frame is static) based on the zoom level of the map. By default the leading edge remains anchored and the trailing edge moves as the scale changes. If the scale is trailing aligned, then it may be more visually appealing to anchor the ScaleView to the trailing edge     ZStack(alignment: .trailing) {         Map(mapScope)         MapScaleView(anchorEdge: .trailing, scope: mapScope)     }     .mapScope(mapScope) You can also use MapScaleView with the mapControls(_:) modifier, as shown in this example:     Map()         .mapControls {             MapScaleView()         }

## Topics

### Creating a map scale view

- [init(anchorEdge:scope:)](mapkit/mapscaleview/init(anchoredge:scope:).md)
- [init(alignment:scope:)](mapkit/mapscaleview/init(alignment: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)
- [MapUserLocationButton](mapkit/mapuserlocationbutton.md)
- [MapZoomStepper](mapkit/mapzoomstepper.md)
