One Logo Pool Ball
_MapKit_SwiftUI · IOS API REFERENCE

MapCompass

struct · iOS 17.0+ · SDK 27.1

@MainActor @preconcurrency struct MapCompass

A view that reflects the current orientation of the associated `Map`. Tapping the compass reorients so that due north is at the top of the `Map` view. May be used in conjunction with `Map` as a stand alone view struct CompassButtonTestView: View { @Namespace var mapScope var body: some View { VStack { Map(scope: mapScope) MapCompass(scope: mapScope) } .mapScope(mapScope) } } MapCompass may also be used in conjunction with the `.mapControls()` modifier Map() .mapControls { MapCompass() }

Members (1)

init · iOS 17.0+

init

TypeScript
static init(scope?: (_SwiftUICore_Namespace_ID) | null): Promise<MapCompass>
Swift declaration
@MainActor @preconcurrency init(scope: Namespace.ID? = nil)

Creates a map compass. - Parameters: - scope: The namespace passed to the associated Map and .mapScope(). For use outside of .mapControls()

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

MapCompass.body

This protocol needs associated types that cannot yet cross the bridge.

All _MapKit_SwiftUI types →