DistanceLeg

data class DistanceLeg(val distance: DistanceValue, val duration: DurationValue, val startLocation: LatLng, val endLocation: LatLng, val startWaypoint: Int, val endWaypoint: Int, val startAddress: String? = null, val endAddress: String? = null, val steps: List<DistanceStep>? = null, val tollSystems: List<TollSystem>? = null, val tolls: List<Toll>? = null)

Leg in a route

Parameters

distance

The total distance expressed in meters (value) and as text. The textual value uses the unit system specified with the units parameter of the original request.

duration

The total duration to travel this route/leg, expressed in seconds (value) and as text. The textual value gives a structured string for duration in the specified language (if available)

startLocation

An object describing a specific location with Latitude and Longitude in decimal degrees.

endLocation

An object describing a specific location with Latitude and Longitude in decimal degrees.

startWaypoint

The start waypoint order number

endWaypoint

The end waypoint order number

startAddress

the starting address of the leg

endAddress

the ending address of the leg

steps

List of steps constituting the leg. Steps are returned when details=full parameter is specified. A step is the most atomic unit of a route, containing a single step describing a specific, single instruction on the journey. The step not only describes the instruction but also contains distance and duration information relating to how this step relates to the following step.

tollSystems

List of objects constituting the information regarding the tolls agencies along the way

tolls

List of objects constituting the information regarding the tolls along the way

Constructors

Link copied to clipboard
constructor(distance: DistanceValue, duration: DurationValue, startLocation: LatLng, endLocation: LatLng, startWaypoint: Int, endWaypoint: Int, startAddress: String? = null, endAddress: String? = null, steps: List<DistanceStep>? = null, tollSystems: List<TollSystem>? = null, tolls: List<Toll>? = null)

Properties

Link copied to clipboard
@SerializedName(value = "distance")
val distance: DistanceValue
Link copied to clipboard
@SerializedName(value = "duration")
val duration: DurationValue
Link copied to clipboard
@SerializedName(value = "end_address")
val endAddress: String? = null
Link copied to clipboard
@SerializedName(value = "end_location")
val endLocation: LatLng
Link copied to clipboard
@SerializedName(value = "end_waypoint")
val endWaypoint: Int
Link copied to clipboard
@SerializedName(value = "start_address")
val startAddress: String? = null
Link copied to clipboard
@SerializedName(value = "start_location")
val startLocation: LatLng
Link copied to clipboard
@SerializedName(value = "start_waypoint")
val startWaypoint: Int
Link copied to clipboard
@SerializedName(value = "steps")
val steps: List<DistanceStep>? = null
Link copied to clipboard
@SerializedName(value = "tolls")
val tolls: List<Toll>? = null
Link copied to clipboard
@SerializedName(value = "tollSystems")
val tollSystems: List<TollSystem>? = null