Select platform: [Android](https://developers.google.com/maps/documentation/maps-3d/android-sdk/add-polylines.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/add-polylines.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/3d/shapes-lines.md.txt "View this page for the JavaScript platform docs.")

<br />

You can add a polyline to a 3D map.

![A map view showing a polyline](https://developers.google.com/static/maps/documentation/maps-3d/ios-sdk/images/polyline.png)

The following code sample demonstrates how to use the
[`Polyline`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polyline.md.txt)
struct to add a polyline and position it on the map.

```swift
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)
  ],
  altitudeMode: .clampToGround
)
.stroke(.init(strokeColor: .green, strokeWidth: 5.0))
.contour(.init(geodesic: false))
```