One Logo Pool Ball
_MapKit_SwiftUI · IOS API REFERENCE

MapUserLocationButton

struct · iOS 17.0+ · SDK 27.1

@MainActor @preconcurrency struct MapUserLocationButton

A button that will set the framing of the associated `Map` to the User Location May be used in conjunction with `Map` as a stand alone view struct LocationButtonTestView: View { @Namespace var mapScope var body: some View { VStack { Map(scope: mapScope) MapUserLocationButton(scope: mapScope) } .mapScope(mapScope) } } MapUserLocationButton may also be used in conjunction with the `.mapControls()` modifier Map() .mapControls { MapUserLocationButton() }

Members (1)

init · iOS 17.0+

init

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

Creates a map user location button. - 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.

MapUserLocationButton.body

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

All _MapKit_SwiftUI types →