Options
All
  • Public
  • Public/Protected
  • All
Menu

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 includes LatLng objects.

Hierarchy

  • DirectionsLeg

Index

Properties

arrival_time?: Time

An estimated arrival time for this leg. Only applicable for TRANSIT requests.

departure_time?: Time

An estimated departure time for this leg. Only applicable for TRANSIT requests.

distance?: Distance

The total distance covered by this leg. This property may be undefined as the distance may be unknown.

duration?: google.maps.Duration

The total duration of this leg. This property may be undefined as the duration may be unknown.

duration_in_traffic?: google.maps.Duration

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.

end_address: string

The address of the destination of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address.

end_location: LatLng

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.

start_address: string

The address of the origin of this leg. This content is meant to be read as-is. Do not programmatically parse the formatted address.

start_location: LatLng

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 DirectionsSteps, each of which contains information about the individual steps in this leg.

traffic_speed_entry: any[]

Information about traffic speed along the leg.

deprecated

This array will always be empty.

via_waypoints: LatLng[]

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