RouteAlertGeometry

class RouteAlertGeometry

Describes the geometry of a RouteAlert that has a length.

Use LineString.fromPolyline with DirectionsRoute.geometry and the precision argument that was used when requesting the route (RouteOptions.Builder.geometries) to decode the route. When decoded, you can find the geometry of the alert using the startGeometryIndex and endGeometryIndex values as arguments for LineString.coordinates. This sublist of coordinates can be used to create and draw the geometry with LineString.fromLngLats.

Also see RouteAlertGeometry.toLineString extension which automates above.

Parameters

length

length of the alert.

startCoordinate

point where the alert starts.

startGeometryIndex

index of a point in the route geometry where the alert starts.

endCoordinate

point where the alert ends.

endGeometryIndex

index of a point in the route geometry where the alert ends.

Types

Builder
Link copied to clipboard
class Builder(length: Double, startCoordinate: Point, startGeometryIndex: Int, endCoordinate: Point, endGeometryIndex: Int)
Use to create a new instance.

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
hashCode
Link copied to clipboard
open override fun hashCode(): Int
Returns a hash code value for the object.
toBuilder
Link copied to clipboard
fun toBuilder(): RouteAlertGeometry.Builder
Transform this object into a builder to mutate the values.
toString
Link copied to clipboard
open override fun toString(): String
Returns a string representation of the object.

Properties

endCoordinate
Link copied to clipboard
val endCoordinate: Point
point where the alert ends.
endGeometryIndex
Link copied to clipboard
val endGeometryIndex: Int
index of a point in the route geometry where the alert ends.
length
Link copied to clipboard
val length: Double
length of the alert.
startCoordinate
Link copied to clipboard
val startCoordinate: Point
point where the alert starts.
startGeometryIndex
Link copied to clipboard
val startGeometryIndex: Int
index of a point in the route geometry where the alert starts.

Extensions

toLineString
Link copied to clipboard
fun RouteAlertGeometry.toLineString(directionsRoute: DirectionsRoute, precision: Int): LineString
Returns a LineString geometry of the alert.
fun RouteAlertGeometry.toLineString(routeLineString: LineString): LineString
Returns a LineString geometry of the alert.