google_directions_api library


Details about the total duration, with the following elements:
Settings for route calculation.
Directions responses contain the following root elements:
When the Directions API returns results, it places them within a (JSON) routes array. Even if the service returns no results (such as if the origin and/or destination doesn't exist) it still returns an empty routes array. (XML responses consist of zero or more
This service is used to calculate route between two points
The status field within the Directions response object contains the status of the request, and may contain debugging information to help you track down why the Directions service failed.
Specifies an intermediate location to include along the route between the origin and destination points as pass through or stopover location. Waypoints alter a route by directing it through the specified location(s).
Details about the total distance covered by this leg, with the following elements:
Specifies the desired time of departure and/or desired assumption of time in traffic calculation for non-transit TravelMode.
Contains the total fare (that is, the total ticket costs) on this route. This property is only returned for transit requests and only for routes where fare information is available for all transit legs. The information includes:
Details about the geocoding of every waypoint, as well as origin and destination, can be found in the (JSON) geocoded_waypoints array. These can be used to infer why the service would return unexpected or no routes.
A pair of latitude and longitude coordinates, stored as degrees.
A latitude/longitude aligned rectangle.
Each element in the legs array specifies a single leg of the journey from the origin to the destination in the calculated route. For routes that contain no waypoints, the route will consist of a single "leg," but for routes that define one or more waypoints, the route will consist of one or more legs, corresponding to the specific legs of the journey.
Contains a single points object that holds an encoded polyline representation of the route. This polyline is an approximate (smoothed) path of the resulting directions.
Each element in the steps array defines a single step of the calculated directions. A step is the most atomic unit of a direction's route, containing a single step describing a specific, single instruction on the journey. E.g. "Turn left at W. 4th St." The step not only describes the instruction but also contains distance and duration information relating to how this step relates to the following step. For example, a step denoted as "Merge onto I-80 West" may contain a duration of "37 miles" and "40 minutes," indicating that the next step is 37 miles/40 minutes from this step.
Details about the time, with the following elements:
Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the durationInTraffic field in the response, which contains the predicted time in traffic based on historical averages. The trafficModel parameter may only be specified for driving directions where the request includes a departureTime.
Provides information about the operator of the line, including the following properties:
Transit directions return additional information that is not relevant for other modes of transportation. These additional properties are exposed through the transit object, returned as a field of an element in the steps array. From the TransitDetails object you can access additional information about the transit stop, transit line and transit agency.
Contains information about the transit line used in this step, and may include the following properties:
Specifies one or more preferred modes of transit. This parameter may only be specified for transit directions. The parameter supports the following arguments:
Specifies the desired time of arrival/departure and/or desired transit types and/or desired routing preference for transit TravelMode.
Specifies preferences for transit routes. Using this parameter, you can bias the options returned, rather than accepting the default best route chosen by the API. This parameter may only be specified for transit directions. The parameter supports the following arguments:
Contains information about the stop/station for this part of the trip. Stop details can include:
Represents an enum of various travel modes.
Directions results contain text within distance fields that may be displayed to the user to indicate the distance of a particular "step" of the route. By default, this text uses the unit system of the origin's country or region.
Contains the type of vehicle used on this line. This may include the following properties:
Type of vehicle.