LegAnnotation

@Serializable
data class LegAnnotation(val distance: List<Double>? = null, val duration: List<Double>? = null, val speed: List<Double>? = null, val maxSpeed: List<MaxSpeed>? = null, val congestion: List<String>? = null)

An annotations object that contains additional details about each line segment along the route geometry. Each entry in an annotations field corresponds to a coordinate along the route geometry.

Since

2.1.0

Constructors

Link copied to clipboard
constructor(distance: List<Double>? = null, duration: List<Double>? = null, speed: List<Double>? = null, maxSpeed: List<MaxSpeed>? = null, congestion: List<String>? = null)

Types

Link copied to clipboard
class Builder

Builder class for creating LegAnnotation instances.

Properties

Link copied to clipboard
val congestion: List<String>? = null

The congestion between each pair of coordinates.

Link copied to clipboard
val distance: List<Double>? = null

The distance, in meters, between each pair of coordinates.

Link copied to clipboard
val duration: List<Double>? = null

The speed, in meters per second, between each pair of coordinates.

Link copied to clipboard
@SerialName(value = "maxspeed")
val maxSpeed: List<MaxSpeed>? = null

The posted speed limit, between each pair of coordinates. Maxspeed is only available for the mapbox/driving and mapbox/driving-traffic profiles, other profiles will return unknowns only.

Link copied to clipboard
val speed: List<Double>? = null

The speed, in meters per second, between each pair of coordinates.

Functions

Link copied to clipboard

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