OptionalendPointIndex?: numberIndex where this leg ends in the route coordinates.
Only present if the route polyline geometry is available.
OptionaloriginalWaypointIndex?: numberIndex, in the locations the route was requested with, of the waypoint this leg ends at.
A leg does not always end at the location with the same index: on an EV route the service
inserts charging stops of its own, so legs[i] is not reliably the leg arriving at
locations[i + 1]. This is the index that maps a leg back to the stop the caller passed.
Absent on the final leg, and on legs that end somewhere the caller did not ask for — an inserted charging stop, for instance.
OptionalstartPointIndex?: numberIndex where this leg starts in the route coordinates.
Only present if the route polyline geometry is available.
Summary statistics for this leg.
Contains departure/arrival times, distances, durations, and consumption estimates specifically for this leg of the journey.
Route section representing a leg between waypoints.
A leg is the portion of route between two consecutive waypoints. This is a top-level section that encompasses the entire journey segment.