# Map A view that displays an embedded map interface. ``` @MainActor @preconcurrency struct Map where Content : View ``` ## Overview Use this SwiftUI view to display a `Map` with markers, annotations, and custom content you provide. You can configure the `Map` to optionally display the user’s location, track a location, and display various controls to allow them to interact with and control the map’s display. The following example displays a map of downtown San Francisco that shows different markers, and an annotation with custom view content at specific locations: ```swift struct ContentView: View { var body: some View { Map { Marker("San Francisco City Hall", coordinate: cityHallLocation) .tint(.orange) Marker("San Francisco Public Library", coordinate: publicLibraryLocation) .tint(.blue) Annotation("Diller Civic Center Playground", coordinate: playgroundLocation) { ZStack { RoundedRectangle(cornerRadius: 5) .fill(Color.yellow) Text("🛝") .padding(5) } } } .mapControlVisibility(.hidden) } } ``` You create markers, annotations, and overlays using [`MapContentBuilder`](/documentation/MapKit/MapContentBuilder) with any of several [`MapContent`](/documentation/MapKit/MapContent) types including: - ``doc://com.apple.mapkit/documentation/MapKit/Annotation`` - ``doc://com.apple.mapkit/documentation/MapKit/UserAnnotation`` - ``doc://com.apple.mapkit/documentation/MapKit/Marker`` - ``doc://com.apple.mapkit/documentation/MapKit/MapCircle`` - ``doc://com.apple.mapkit/documentation/MapKit/MapPolygon`` - ``doc://com.apple.mapkit/documentation/MapKit/MapPolyline`` You can also add a variety of controls to allow a person to interact with the map to change the map’s scale, display or hide the device’s current location, and so on: - ``doc://com.apple.mapkit/documentation/MapKit/MapCompass`` - `MapPitchButton` - ``doc://com.apple.mapkit/documentation/MapKit/MapPitchSlider`` - ``doc://com.apple.mapkit/documentation/MapKit/MapScaleView`` - ``doc://com.apple.mapkit/documentation/MapKit/MapUserLocationButton`` - ``doc://com.apple.mapkit/documentation/MapKit/MapZoomStepper`` ## Topics ### Creating a map [`init(bounds:interactionModes:scope:)`](/documentation/MapKit/Map/init(bounds:interactionModes:scope:)) Creates a new, empty map with the bounds, interaction modes, and scope you provide. [`init(bounds:interactionModes:scope:content:)`](/documentation/MapKit/Map/init(bounds:interactionModes:scope:content:)) Creates a new map with the bounds, interaction modes, scope, and content you provide. [`init(bounds:interactionModes:selection:scope:)`](/documentation/MapKit/Map/init(bounds:interactionModes:selection:scope:)-11lec) Creates a new, empty map with the bounds, interaction modes, a binding to a map feature, and scope you provide. [`init(bounds:interactionModes:selection:scope:)`](/documentation/MapKit/Map/init(bounds:interactionModes:selection:scope:)-236di) Creates a new, empty map with the bounds, interaction modes, the selected map feature, and scope you provide. [`init(bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(bounds:interactionModes:selection:scope:content:)-28wns) Creates a new map with the bounds, interaction modes, selected map feature, scope, and map content you provide. [`init(bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(bounds:interactionModes:selection:scope:content:)-2tdbr) Creates a new map with the bounds, interaction modes, selected value, scope, and map content you provide. [`init(initialPosition:bounds:interactionModes:scope:)`](/documentation/MapKit/Map/init(initialPosition:bounds:interactionModes:scope:)) Creates a new, empty map with the initial camera position, bounds, interaction modes, and scope you provide. [`init(initialPosition:bounds:interactionModes:scope:content:)`](/documentation/MapKit/Map/init(initialPosition:bounds:interactionModes:scope:content:)) Creates a new map with the initial camera position, bounds, interaction modes, scope, and map content you provide. [`init(initialPosition:bounds:interactionModes:selection:scope:)`](/documentation/MapKit/Map/init(initialPosition:bounds:interactionModes:selection:scope:)) Creates a new, empty map with the initial camera position, bounds, interaction modes, selected map feature, and scope you provide. [`init(initialPosition:bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(initialPosition:bounds:interactionModes:selection:scope:content:)-9feos) Creates a new map with the initial camera position, bounds, interaction modes, selected map feature, scope, and content you provide. [`init(initialPosition:bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(initialPosition:bounds:interactionModes:selection:scope:content:)-451vp) Creates a new map with the initial camera position, bounds, interaction modes, selected map feature, scope, and content you provide. [`init(position:bounds:interactionModes:scope:)`](/documentation/MapKit/Map/init(position:bounds:interactionModes:scope:)) Creates a new, empty map with the initial camera position, bounds, interaction modes, and scope you provide. [`init(position:bounds:interactionModes:scope:content:)`](/documentation/MapKit/Map/init(position:bounds:interactionModes:scope:content:)) Creates a new map with the initial camera position, bounds, interaction modes, scope, and content you provide. [`init(position:bounds:interactionModes:selection:scope:)`](/documentation/MapKit/Map/init(position:bounds:interactionModes:selection:scope:)) Creates a new map with the initial camera position, bounds, interaction modes, scope, and content you provide. [`init(position:bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(position:bounds:interactionModes:selection:scope:content:)-47y4p) Creates a new map with the initial camera position, bounds, interaction modes, selected feature, scope, and content you provide. [`init(position:bounds:interactionModes:selection:scope:content:)`](/documentation/MapKit/Map/init(position:bounds:interactionModes:selection:scope:content:)-9xq1q) Creates a new map with the initial camera position, bounds, interaction modes, selected feature, scope, and content you provide. [`MapInteractionModes`](/documentation/MapKit/MapInteractionModes) Options that indicate the user interactions that the map responds to. ### Accessing the view body ### Managing feature selection ### Managing Look Around view presentation ### Managing map control sizing and visibility ### Managing the camera ### Setting the namespace Identifier ### Setting the map style ### Type aliases ### Deprecated [Deprecated Symbols](/documentation/MapKit/deprecated-symbols) Map protocols and view modifiers that are no longer supported. ### Displaying place information [`mapItemDetailSelectionAccessory(_:)`](/documentation/MapKit/MapContent/mapItemDetailSelectionAccessory(_:)) Specifies the selection accessory to display for the selected map item content. --- Copyright © 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)