# Marker

    @MainActor
    @preconcurrency
    struct Marker<Content> where Content : View

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

A type that allows you to display custom SwiftUI content over the Map, anchored to a position on
the 3D map.

Default content is a `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Pin.html` view.

    Map(mode: .hybrid) {
      Marker(position: .init(latitude: 37.7749, longitude: -122.4194, altitude: 0)) {
        Image(systemName: "car")
      }
    }

- `


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


  ` 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

- `


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


  ` The altitude interpretation for the `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker.html#/s:12GoogleMaps3D6MarkerV8positionAA14LatLngAltitudeVvp`.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      let 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/Marker#/s:12GoogleMaps3D6MarkerV4bodyQrvp)


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

- `


  ### [init(position:altitudeMode:collisionBehavior:collisionPriority:content:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker#/s:12GoogleMaps3D6MarkerV8position12altitudeMode17collisionBehavior0G8Priority7contentACyxGAA14LatLngAltitudeV_AA0mF0OAA09CollisionH0OSiSgxyXEtcfc)


  ` Creates a Marker anchored to a specific coordinate.

  #### 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, collisionPriority: Int? = nil, @ViewBuilder content: () -> Content = { https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Pin.html() })

  #### Parameters

  |---|---|
  | ` position ` | The geographic coordinate to anchor to. |
  | ` altitudeMode ` | The altitude interpretation for the `https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker.html#/s:12GoogleMaps3D6MarkerV8positionAA14LatLngAltitudeVvp`. Default value: `.clampToGround`. |
  | ` collisionBehavior ` | The collision behavior of the Marker. Default value: `.required`. |
  | ` collisionPriority ` | A number which is used to help determine relative priority between optional collision behavior markers. A higher collisionPriority value indicates higher priority. |
  | ` content ` | The SwiftUI view to display inside the Marker. Default value: `Pin()`. |

- `


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


  ` The geographic coordinate to anchor the Marker to.

  #### Declaration

  Swift

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