# Marker3D

    @MainActor
    @preconcurrency
    struct Marker3D

    extension Marker3D : MapContent, https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Protocols/MapContentAnchorable.html, https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Protocols.html#/s:12GoogleMaps3D18MapContentTappableP, Sendable, SendableMetatype, View

A 3D marker that can be placed on a map.

    Map(mode: .hybrid) {
      Marker3D(position: .init(latitude: 37.7749, longitude: -122.4194, altitude: 0))
    }

- `


  ### [Body](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV4Bodya)


  ` 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

      typealias Body = some View

- `


  ### [Style](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D/Style.html)


  ` Defines the visual style and content of a `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D.html`.

  #### Declaration

  Swift

      struct Style

- `


  ### [altitudeMode](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV12altitudeModeAA08AltitudeE0Ovp)


  ` Specifies how altitude in the position is interpreted.

  Default value: `clampToGround`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var altitudeMode: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/AltitudeMode.html

- `


  ### [body](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV4bodyQrvp)


  ` 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 }

- `


  ### [collisionBehavior](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV17collisionBehaviorAA09CollisionE0Ovp)


  ` Specifies how a `Marker3D` should behave when it collides with another
  `Marker3D` or with the default map labels.

  Default value: `required`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var collisionBehavior: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/CollisionBehavior.html

- `


  ### [drawsWhenOccluded](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV17drawsWhenOccludedSbvp)


  ` Specifies whether this Marker3D should be drawn or not when it's occluded.
  The Marker3D can be occluded by map geometry (e.g. buildings).

  Default value: `false`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var drawsWhenOccluded: Bool

- `


  ### [extruded](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV8extrudedSbvp)


  ` Specifies whether to connect the Marker3D to the ground. To extrude a
  Marker3D, the altitudeMode must be either `relativeToGround`,
  `relativeToMesh` or `absolute`.

  Default value: `false`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var extruded: Bool

- `


  ### [init(position:altitudeMode:collisionBehavior:extruded:drawsWhenOccluded:sizePreserved:zIndex:label:style:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV8position12altitudeMode17collisionBehavior8extruded17drawsWhenOccluded13sizePreserved6zIndex5label5styleAcA14LatLngAltitudeV_AA0tF0OAA09CollisionH0OS3bs5Int32VSSAC5StyleVtcfc)


  ` Creates a new Marker3D.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      init(position: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/LatLngAltitude.html, altitudeMode: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/AltitudeMode.html = .clampToGround, collisionBehavior: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/CollisionBehavior.html = .required, extruded: Bool = false, drawsWhenOccluded: Bool = false, sizePreserved: Bool = false, zIndex: Int32 = 0, label: String = "", style: Marker3D.https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D/Style.html = .default)

  #### Parameters

  |---|---|
  | ` position ` | The position of the Marker3D. |
  | ` altitudeMode ` | Specifies how altitude in the position is interpreted. Default value: `clampToGround` |
  | ` collisionBehavior ` | Specifies how a `Marker3D` should behave when it collides with another `Marker3D` or with the default map labels. Default value: `required` |
  | ` extruded ` | Specifies whether to connect the Marker3D to the ground. To extrude a Marker3D, the altitudeMode must be either `relativeToGround`, `relativeToMesh` or `absolute`. Default value: `false` |
  | ` drawsWhenOccluded ` | Specifies whether this Marker3D should be drawn or not when it's occluded. The Marker3D can be occluded by map geometry (e.g. buildings). Default value: `false` |
  | ` sizePreserved ` | Specifies whether this Marker3D should preserve its size or not regardless of distance from camera. By default the Marker3D is scaled based on distance from camera/tilt. Default value: `false` |
  | ` zIndex ` | The zIndex compared to other 3D Marker3Ds. By default, `Marker3Ds` are displayed according to their vertical position on screen, with lower `Marker3Ds``appearing in front of`Marker3D`farther up the screen. Note that`zIndex`is also used to help determine relative priority between`CollisionBehavior.optionalAndHidesLowerPriority`3D Marker3Ds. A higher`zIndex`value indicates higher priority. Default value:`0\` |
  | ` label ` | Text to be displayed by this Marker3D. Defaults to empty string. |
  | ` style ` | The style of the Marker3D. |

- `


  ### [label](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV5labelSSvp)


  ` Text to be displayed by this Marker3D.

  Defaults to empty string.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var label: String

- `


  ### [position](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV8positionAA14LatLngAltitudeVvp)


  ` Sets the position.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var position: https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/LatLngAltitude.html

- `


  ### [sizePreserved](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV13sizePreservedSbvp)


  ` Specifies whether this Marker3D should preserve its size or not regardless
  of distance from camera. By default the Marker3D is scaled based on
  distance from camera/tilt.

  Default value: `false`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var sizePreserved: Bool

- `


  ### [zIndex](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D#/s:12GoogleMaps3D8Marker3DV6zIndexs5Int32Vvp)


  ` The zIndex compared to other 3D Marker3Ds. By default, `Marker3Ds` are
  displayed according to their vertical position on screen, with lower
  `Marker3D`s appearing in front of `Marker3D` farther up the screen. Note
  that `zIndex` is also used to help determine relative priority between
  `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Enums/CollisionBehavior.html#/s:12GoogleMaps3D17CollisionBehaviorO29optionalAndHidesLowerPriorityyA2CmF` 3D Marker3Ds. A higher
  `zIndex` value indicates higher priority.

  Default value: `0`

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var zIndex: Int32