An estimated arrival time for this leg. Only applicable for TRANSIT requests.
An estimated departure time for this leg. Only applicable for TRANSIT requests.
The total distance covered by this leg. This property may be undefined as the distance may be unknown.
The total duration of this leg. This property may be
undefined
as the duration may be unknown.
The total duration of this leg, taking into account the traffic
conditions indicated by the trafficModel
property. This
property may be undefined
as the duration may be unknown.
The address of the destination of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address.
The DirectionsService
calculates directions between
locations by using the nearest transportation option (usually a road) at
the start and end locations. end_location
indicates the
actual geocoded destination, which may be different than the
end_location
of the last step if, for example, the road is
not near the destination of this leg.
The address of the origin of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address.
The DirectionsService
calculates directions between
locations by using the nearest transportation option (usually a road) at
the start and end locations. start_location
indicates the
actual geocoded origin, which may be different than the
start_location
of the first step if, for example, the road
is not near the origin of this leg.
An array of DirectionsStep
s, each of which contains
information about the individual steps in this leg.
Information about traffic speed along the leg.
An array of non-stopover waypoints along this leg, which were specified in the original request.
Deprecated in alternative
routes. Version 3.27 will be the last version of the API that
adds extra via_waypoints
in alternative routes.
When using the Directions Service to implement draggable directions, it is recommended to disable dragging of alternative routes. Only the main route should be draggable. Users can drag the main route until it matches an alternative route.
Generated using TypeDoc
A single leg consisting of a set of steps in a
DirectionsResult
. Some fields in the leg may not be returned for all requests. Note that though this result is "JSON-like," it is not strictly JSON, as it directly and indirectly includesLatLng
objects.