google.maps.DirectionsRoute interface
A single route containing a set of legs in a DirectionsResult. Note that though this object is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects.
Properties
Type: LatLngBounds
The bounds for this route.
Type: string
Copyrights text to be displayed for this route.
Type: TransitFare
The total fare for the whole transit trip. Only applicable to transit requests.
Type: Array<DirectionsLeg>
An array of DirectionsLegs, each of which contains information about the steps of which it is composed. There will be one leg for each stopover waypoint or destination specified. So a route with no stopover waypoints will contain one DirectionsLeg and a route with one stopover waypoint will contain two.
Type: Array<LatLng>
An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs).
Type: string
An encoded polyline representation of the route in overview_path. This polyline is an approximate (smoothed) path of the resulting directions.
Type: Array
Warnings to be displayed when showing these directions.
Type: Array
If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was:
Origin: Los Angeles
Waypoints: Dallas, Bangor, Phoenix
Destination: New York
and the optimized output was ordered as follows:
Origin: Los Angeles
Waypoints: Phoenix, Dallas, Bangor
Destination: New York
then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based.
If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries.