---
title: "init(anchorEdge:scope:)"
framework: mapkit
role: symbol
role_heading: Initializer
path: "mapkit/mapscaleview/init(anchoredge:scope:)"
---

# init(anchorEdge:scope:)

Creates a map scale view.

## Declaration

```swift
@MainActor @preconcurrency init(anchorEdge: HorizontalEdge = .leading, scope: Namespace.ID? = nil)
```

## Parameters

- `anchorEdge`: The fixed edge the scale grows and shrinks from. Use this outside of Map/mapControls(_:) view modifier.
- `scope`: A doc://com.apple.documentation/documentation/SwiftUI/Namespace/ID value that identifies this namespace and that you can use to associate this control with a map instance.

## See Also

### Creating a map scale view

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