GoogleMaps3D Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Polyline
struct Polyline
extension Polyline : Copyable, Equatable, Escapable, Hashable, Identifiable, MapContent
A 3D polyline that can be placed on a map.
Map(mode: .hybrid) {
Polyline(coordinates: [
.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),
])
}
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a
and b
,
a == b
implies that a != b
is false
.
Declaration
Swift
static func == (a: Polyline, b: Polyline) -> Bool
-
Declaration
Swift
struct ContourStyle
extension Polyline.ContourStyle : Equatable, Hashable
-
A type representing the stable identity of the entity associated with
an instance.
Declaration
Swift
@available(watchOS, introduced: 6.0)
@available(macOS, introduced: 10.15)
@available(iOS, introduced: 13.0)
@available(tvOS, introduced: 13.0)
typealias ID = String
-
Declaration
Swift
struct StrokeStyle
extension Polyline.StrokeStyle : Equatable, Hashable
-
Declaration
Swift
func add(coordinator: RenderingCoordinator)
-
Specifies how altitudes in the coordinates are interpreted.
Default value: clampToGround.
-
Declaration
Swift
func contour(_ style: Polyline.ContourStyle) -> Polyline
-
Values that define how polylines are drawn to represent the contour of the Earth.
-
Sets the coordinates of the polyline.
-
The draw order compared to other polys.
Default value: 0.
Declaration
Swift
var drawOrder: Int32
-
Hashes the essential components of this value by feeding them into the
given hasher.
Implement this method to conform to the Hashable
protocol. The
components used for hashing must be the same as the components compared
in your type’s ==
operator implementation. Call hasher.combine(_:)
with each of these components.
Important
In your implementation of hash(into:)
,
don’t call finalize()
on the hasher
instance provided,
or replace it with a different instance.
Doing so may become a compile-time error in the future.
Declaration
Swift
func hash(into hasher: inout Hasher)
-
The hash value.
Hash values are not guaranteed to be equal across different executions of
your program. Do not save hash values to use during a future execution.
Important
hashValue
is deprecated as a
Hashable
requirement. To
conform to
Hashable
, implement the
hash(into:)
requirement instead.
The compiler provides an implementation for
hashValue
for you.
Declaration
Swift
var hashValue: Int { get }
-
-
-
Declaration
Swift
func remove(coordinator: RenderingCoordinator)
-
Declaration
Swift
func stroke(_ style: Polyline.StrokeStyle) -> Polyline
-
Stroke style of the polyline.
-
Declaration
Swift
func update(coordinator: RenderingCoordinator)
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\nPolyline\n========\n\n struct Polyline\n\n extension Polyline : Copyable, Equatable, Escapable, Hashable, Identifiable, MapContent\n\nA 3D polyline that can be placed on a map. \n\n Map(mode: .hybrid) {\n Polyline(coordinates: [\n .init(latitude: 37.7749, longitude: -122.4194, altitude: 100),\n .init(latitude: 37.7750, longitude: -122.4193, altitude: 100),\n .init(latitude: 37.7751, longitude: -122.4192, altitude: 100),\n ])\n }\n\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:12GoogleMaps3D8PolylineV2eeoiySbAC_ACtFZ)\n\n `\n ` \n Returns a Boolean value indicating whether two values are equal.\n\n Equality is the inverse of inequality. For any values `a` and `b`,\n `a == b` implies that `a != b` is `false`. \n\n #### Declaration\n\n Swift \n\n static func == (a: Polyline, b: Polyline) -\u003e Bool\n\n- `\n ``\n ``\n `\n\n ### [ContourStyle](../Structs/Polyline/ContourStyle.html)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n struct ContourStyle\n\n extension ../Structs/Polyline.html.ContourStyle : Equatable, Hashable\n\n- `\n ``\n ``\n `\n\n ### [ID](#/s:12GoogleMaps3D8PolylineV2IDa)\n\n `\n ` \n A type representing the stable identity of the entity associated with\n an instance. \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 ID = String\n\n- `\n ``\n ``\n `\n\n ### [StrokeStyle](../Structs/Polyline/StrokeStyle.html)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n struct StrokeStyle\n\n extension ../Structs/Polyline.html.StrokeStyle : Equatable, Hashable\n\n- `\n ``\n ``\n `\n\n ### [add(coordinator:)](#/s:12GoogleMaps3D8PolylineV3add11coordinatoryAA20RenderingCoordinatorC_tF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func add(coordinator: RenderingCoordinator)\n\n- `\n ``\n ``\n `\n\n ### [altitudeMode](#/s:12GoogleMaps3D8PolylineV12altitudeModeAA08AltitudeE0Ovp)\n\n `\n ` \n Specifies how altitudes in the coordinates are interpreted.\n Default value: clampToGround. \n\n #### Declaration\n\n Swift \n\n var altitudeMode: ../Enums/AltitudeMode.html\n\n- `\n ``\n ``\n `\n\n ### [contour(_:)](#/s:12GoogleMaps3D8PolylineV7contouryA2C12ContourStyleVF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func contour(_ style: Polyline.../Structs/Polyline/ContourStyle.html) -\u003e Polyline\n\n- `\n ``\n ``\n `\n\n ### [contourStyle](#/s:12GoogleMaps3D8PolylineV12contourStyleAC07ContourE0Vvp)\n\n `\n ` \n Values that define how polylines are drawn to represent the contour of the Earth. \n\n #### Declaration\n\n Swift \n\n var contourStyle: Polyline.../Structs/Polyline/ContourStyle.html\n\n- `\n ``\n ``\n `\n\n ### [coordinates](#/s:12GoogleMaps3D8PolylineV11coordinatesSayAA14LatLngAltitudeVGvp)\n\n `\n ` \n Sets the coordinates of the polyline. \n\n #### Declaration\n\n Swift \n\n var coordinates: [../Structs/LatLngAltitude.html]\n\n- `\n ``\n ``\n `\n\n ### [drawOrder](#/s:12GoogleMaps3D8PolylineV9drawOrders5Int32Vvp)\n\n `\n ` \n The draw order compared to other polys.\n Default value: 0. \n\n #### Declaration\n\n Swift \n\n var drawOrder: Int32\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:12GoogleMaps3D8PolylineV4hash4intoys6HasherVz_tF)\n\n `\n ` \n Hashes the essential components of this value by feeding them into the\n given hasher.\n\n Implement this method to conform to the `Hashable` protocol. The\n components used for hashing must be the same as the components compared\n in your type's `==` operator implementation. Call `hasher.combine(_:)`\n with each of these components. \n Important\n\n In your implementation of `hash(into:)`,\n don't call `finalize()` on the `hasher` instance provided,\n or replace it with a different instance.\n Doing so may become a compile-time error in the future. \n\n #### Declaration\n\n Swift \n\n func hash(into hasher: inout Hasher)\n\n- `\n ``\n ``\n `\n\n ### [hashValue](#/s:12GoogleMaps3D8PolylineV9hashValueSivp)\n\n `\n ` \n The hash value.\n\n Hash values are not guaranteed to be equal across different executions of\n your program. Do not save hash values to use during a future execution. \n Important\n `hashValue` is deprecated as a `Hashable` requirement. To conform to `Hashable`, implement the [hash(into:)](../Structs/Polyline.html#/s:12GoogleMaps3D8PolylineV4hash4intoys6HasherVz_tF) requirement instead. The compiler provides an implementation for `hashValue` for you. \n\n #### Declaration\n\n Swift \n\n var hashValue: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [id](#/s:12GoogleMaps3D8PolylineV2idSSvp)\n\n `\n ` \n Unique identifier \n\n #### Declaration\n\n Swift \n\n let id: String\n\n- `\n ``\n ``\n `\n\n ### [init(coordinates:altitudeMode:drawOrder:)](#/s:12GoogleMaps3D8PolylineV11coordinates12altitudeMode9drawOrderACSayAA14LatLngAltitudeVG_AA0kF0Os5Int32Vtcfc)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n init(coordinates: [../Structs/LatLngAltitude.html], altitudeMode: ../Enums/AltitudeMode.html = .clampToGround, drawOrder: Int32 = 0)\n\n- `\n ``\n ``\n `\n\n ### [remove(coordinator:)](#/s:12GoogleMaps3D8PolylineV6remove11coordinatoryAA20RenderingCoordinatorC_tF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func remove(coordinator: RenderingCoordinator)\n\n- `\n ``\n ``\n `\n\n ### [stroke(_:)](#/s:12GoogleMaps3D8PolylineV6strokeyA2C11StrokeStyleVF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func stroke(_ style: Polyline.../Structs/Polyline/StrokeStyle.html) -\u003e Polyline\n\n- `\n ``\n ``\n `\n\n ### [strokeStyle](#/s:12GoogleMaps3D8PolylineV11strokeStyleAC06StrokeE0Vvp)\n\n `\n ` \n Stroke style of the polyline. \n\n #### Declaration\n\n Swift \n\n var strokeStyle: Polyline.../Structs/Polyline/StrokeStyle.html\n\n- `\n ``\n ``\n `\n\n ### [update(coordinator:)](#/s:12GoogleMaps3D8PolylineV6update11coordinatoryAA20RenderingCoordinatorC_tF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func update(coordinator: RenderingCoordinator)"]]