# Polyline

    @MainActor
    @preconcurrency
    struct Polyline

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

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

    Map(mode: .hybrid) {
      Polyline(path: [
        .init(latitude: 37.7749, longitude: -122.4194, altitude: 100),
        .init(latitude: 37.7750, longitude: -122.4193, altitude: 100),
        .init(latitude: 37.7751, longitude: -122.4192, altitude: 100),
      ])
    }

- `


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


  ` 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

- `


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


  `

  #### Declaration

  Swift

      struct ContourStyle

      extension https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline.html.ContourStyle : Equatable, Hashable

- `


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


  `

  #### Declaration

  Swift

      struct StrokeStyle

      extension https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline.html.StrokeStyle : Equatable, Hashable

- `


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


  ` Specifies how altitudes in the path are 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/Polyline#/s:12GoogleMaps3D8PolylineV4bodyQrvp)


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

- `


  ### [contour(_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV7contouryA2C12ContourStyleVF)


  `

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      func contour(_ style: Polyline.https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline/ContourStyle.html) -> Polyline

- `


  ### [contourStyle](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV12contourStyleAC07ContourE0Vvp)


  ` Values that define how polylines are drawn to represent the contour of the Earth.

  #### Declaration

  Swift

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

- `


  ### [init(path:altitudeMode:zIndex:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV4path12altitudeMode6zIndexACSayAA14LatLngAltitudeVG_AA0jF0Os5Int32Vtcfc)


  `

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      init(path: [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, zIndex: Int32 = 0)

- `


  ### [path](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV4pathSayAA14LatLngAltitudeVGvp)


  ` Sets the path of the polyline in LatLngAltitude coordinates.

  #### Declaration

  Swift

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

- `


  ### [stroke(_:)](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV6strokeyA2C11StrokeStyleVF)


  `

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      func stroke(_ style: Polyline.https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline/StrokeStyle.html) -> Polyline

- `


  ### [strokeStyle](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline#/s:12GoogleMaps3D8PolylineV11strokeStyleAC06StrokeE0Vvp)


  ` Stroke style of the polyline.

  #### Declaration

  Swift

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

- `


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


  ` The draw order compared to other polys.
  Default value: 0.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var zIndex: Int32