GoogleMaps3D Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Map
@MainActor
@preconcurrency
struct Map
extension Map : MapAnimatable, Sendable, View
-
The type of view representing the body of this view.
When you create a custom view, Swift infers this type from your
implementation of the required View/body-swift.property
property.
Declaration
Swift
@available(watchOS, introduced: 6.0)
@available(macOS, introduced: 10.15)
@available(iOS, introduced: 13.0)
@available(tvOS, introduced: 13.0)
typealias Body = some View
-
The API key to use for the Google Maps SDK.
This is required to use the Google Maps SDK.
Declaration
Swift
@MainActor
@preconcurrency
static var apiKey: String { get set }
-
The content and behavior of the view.
When you implement a custom view, you must implement a computed
body
property to provide the content for your view. Return a view
that’s composed of built-in views that SwiftUI provides, plus other
composite views that you’ve already defined:
struct MyView: View {
var body: some View {
Text("Hello, World!")
}
}
For more information about composing views and a view hierarchy,
see doc:Declaring-a-Custom-View.
Declaration
Swift
@MainActor
@preconcurrency
var body: some View { get }
-
Declaration
Swift
@MainActor
@preconcurrency
var coordinator: RenderingCoordinator
-
Initializes the map view with the specified camera, mode, and content.
This method configures the map’s initial viewpoint, rendering style, and displayed content.
Declaration
Swift
@MainActor
@preconcurrency
init(camera: Binding<Camera>, mode: MapMode, @MapContentBuilder content: () -> any MapContent = { MapContentArray.empty })
Parameters
camera
|
The camera position and orientation binding, defining the map’s viewport.
|
mode
|
The desired map mode (e.g., .hybrid , .satellite ).
|
content
|
The content to be displayed on the map. This parameter is optional;
|
-
Initializes the map view with the specified camera, mode, and content.
This method configures the map’s initial viewpoint and rendering style.
Declaration
Swift
@MainActor
@preconcurrency
init(initialCamera: Camera = .init(latitude: 0, longitude: 0, altitude: 63_170_000), mode: MapMode, @MapContentBuilder content: () -> any MapContent = { MapContentArray.empty })
Parameters
initialCamera
|
The initial camera position and orientation, defining the map’s viewport.
Defaults to a global view at {latitude: 0, longitude: 0, altitude: 63,170,000 meters}.
|
mode
|
The desired map mode (e.g., .hybrid , .satellite ).
|
content
|
The content to be displayed on the map. This parameter is optional;
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[],[],null,["# GoogleMaps3D Framework Reference\n\nMap\n===\n\n @MainActor\n @preconcurrency\n struct Map\n\n extension Map : MapAnimatable, Sendable, View\n\n- `\n ``\n ``\n `\n\n ### [Body](#/s:12GoogleMaps3D3MapV4Bodya)\n\n `\n ` \n The type of view representing the body of this view.\n\n When you create a custom view, Swift infers this type from your\n implementation of the required `View/body-swift.property` property. \n\n #### Declaration\n\n Swift \n\n @available(watchOS, introduced: 6.0)\n @available(macOS, introduced: 10.15)\n @available(iOS, introduced: 13.0)\n @available(tvOS, introduced: 13.0)\n typealias Body = some View\n\n- `\n ``\n ``\n `\n\n ### [apiKey](#/s:12GoogleMaps3D3MapV6apiKeySSvpZ)\n\n `\n ` \n The API key to use for the Google Maps SDK.\n\n This is required to use the Google Maps SDK. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n static var apiKey: String { get set }\n\n- `\n ``\n ``\n `\n\n ### [body](#/s:12GoogleMaps3D3MapV4bodyQrvp)\n\n `\n ` \n The content and behavior of the view.\n\n When you implement a custom view, you must implement a computed\n `body` property to provide the content for your view. Return a view\n that's composed of built-in views that SwiftUI provides, plus other\n composite views that you've already defined: \n\n struct MyView: View {\n var body: some View {\n Text(\"Hello, World!\")\n }\n }\n\n For more information about composing views and a view hierarchy,\n see \u003cdoc:Declaring-a-Custom-View\u003e. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n var body: some View { get }\n\n- `\n ``\n ``\n `\n\n ### [coordinator](#/s:12GoogleMaps3D3MapV11coordinatorAA20RenderingCoordinatorCvp)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n var coordinator: RenderingCoordinator\n\n- `\n ``\n ``\n `\n\n ### [init(camera:mode:content:)](#/s:12GoogleMaps3D3MapV6camera4mode7contentAC7SwiftUI7BindingVyAA6CameraVG_AA0C4ModeOAA0C7Content_pyXEtcfc)\n\n `\n ` \n Initializes the map view with the specified camera, mode, and content.\n\n This method configures the map's initial viewpoint, rendering style, and displayed content. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n init(camera: Binding\u003c../Structs/Camera.html\u003e, mode: ../Enums/MapMode.html, @MapContentBuilder content: () -\u003e any MapContent = { MapContentArray.empty })\n\n #### Parameters\n\n |-----------------|---------------------------------------------------------------------------|\n | ` `*camera*` ` | The camera position and orientation binding, defining the map's viewport. |\n | ` `*mode*` ` | The desired map mode (e.g., `.hybrid`, `.satellite`). |\n | ` `*content*` ` | The content to be displayed on the map. This parameter is optional; |\n\n- `\n ``\n ``\n `\n\n ### [init(initialCamera:mode:content:)](#/s:12GoogleMaps3D3MapV13initialCamera4mode7contentAcA0E0V_AA0C4ModeOAA0C7Content_pyXEtcfc)\n\n `\n ` \n Initializes the map view with the specified camera, mode, and content.\n\n This method configures the map's initial viewpoint and rendering style. \n\n #### Declaration\n\n Swift \n\n @MainActor\n @preconcurrency\n init(initialCamera: ../Structs/Camera.html = .init(latitude: 0, longitude: 0, altitude: 63_170_000), mode: ../Enums/MapMode.html, @MapContentBuilder content: () -\u003e any MapContent = { MapContentArray.empty })\n\n #### Parameters\n\n |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*initialCamera*` ` | The initial camera position and orientation, defining the map's viewport. Defaults to a global view at {latitude: 0, longitude: 0, altitude: 63,170,000 meters}. |\n | ` `*mode*` ` | The desired map mode (e.g., `.hybrid`, `.satellite`). |\n | ` `*content*` ` | The content to be displayed on the map. This parameter is optional; |"]]