RouteLeg

@Serializable
data class RouteLeg(val distance: Double, val duration: Double, val steps: List<LegStep>, val durationTypical: Double? = null, val summary: String? = null, val admins: List<Admin>? = null, val incidents: List<Incident>? = null, val annotation: LegAnnotation? = null, val closures: List<Closure>? = null)

A route between only two DirectionsWaypoint.

Since

1.0.0

Constructors

Link copied to clipboard
constructor(distance: Double, duration: Double, steps: List<LegStep>, durationTypical: Double? = null, summary: String? = null, admins: List<Admin>? = null, incidents: List<Incident>? = null, annotation: LegAnnotation? = null, closures: List<Closure>? = null)

Types

Link copied to clipboard
class Builder(distance: Double, duration: Double, steps: List<LegStep>)

Builder class for creating RouteLeg instances.

Properties

Link copied to clipboard
val admins: List<Admin>? = null

An array of objects describing the administrative boundaries the route leg travels through. Use StepIntersection.adminIndex on the intersection object to look up the admin for each intersection in this array.

Link copied to clipboard

A LegAnnotation that contains additional details about each line segment along the route geometry. If you'd like to receiving this, you must request it inside your Directions request before executing the call.

Link copied to clipboard
val closures: List<Closure>? = null

A list of closures that occur on this leg.

Link copied to clipboard

The distance traveled from one waypoint to another.

Link copied to clipboard

The estimated travel time from one waypoint to another.

Link copied to clipboard
@SerialName(value = "duration_typical")
val durationTypical: Double? = null

The typical travel time for traversing this RouteLeg. There's a delay along the RouteLeg if you subtract this durationTypical() value from the RouteLeg duration() value and the resulting difference is greater than 0. The delay is because of any number of real-world situations (road repair, traffic jam, etc).

Link copied to clipboard
val incidents: List<Incident>? = null

A list of incidents that occur on this leg.

Link copied to clipboard

Gives a List including all the steps to get from one waypoint to another.

Link copied to clipboard
val summary: String? = null

A short human-readable summary of major roads traversed. Useful to distinguish alternatives.

Functions

Link copied to clipboard

Creates a builder initialized with the current values of the RouteLeg instance.