- JSON representation
- RouteLeg
- Polyline
- RouteLegStep
- NavigationInstruction
- RouteLegStepTravelAdvisory
- RouteLegTravelAdvisory
Encapsulates a route, which consists of a series of connected road segments that join beginning, ending, and intermediate waypoints.
JSON representation |
---|
{ "legs": [ { object ( |
Fields | |
---|---|
legs[] |
A collection of legs (path segments between waypoints) that make-up the route. Each leg corresponds to the trip between two non- |
distanceMeters |
The travel distance of the route, in meters. |
duration |
The length of time needed to navigate the route. If you set the A duration in seconds with up to nine fractional digits, ending with ' |
staticDuration |
The duration of traveling through the route without taking traffic conditions into consideration. A duration in seconds with up to nine fractional digits, ending with ' |
polyline |
The overall route polyline. This polyline will be the combined polyline of all |
description |
A description of the route. |
warnings[] |
An array of warnings to show when displaying the route. |
viewport |
The viewport bounding box of the polyline. |
travelAdvisory |
Additional information about the route. |
optimizedIntermediateWaypointIndex[] |
If ComputeRoutesRequest.optimize_waypoint_order is set to true, this field contains the optimized ordering of intermediates waypoints. otherwise, this field is empty. For example, suppose the input is Origin: LA; Intermediates: Dallas, Bangor, Phoenix; Destination: New York; and the optimized intermediate waypoint order is: Phoenix, Dallas, Bangor. Then this field contains the values [2, 0, 1]. The index starts with 0 for the first intermediate waypoint. |
RouteLeg
Encapsulates a segment between non-via
waypoints.
JSON representation |
---|
{ "distanceMeters": integer, "duration": string, "staticDuration": string, "polyline": { object ( |
Fields | |
---|---|
distanceMeters |
The travel distance of the route leg, in meters. |
duration |
The length of time needed to navigate the leg. If the A duration in seconds with up to nine fractional digits, ending with ' |
staticDuration |
The duration of traveling through the leg, calculated without taking traffic conditions into consideration. A duration in seconds with up to nine fractional digits, ending with ' |
polyline |
The overall polyline for this leg. This includes that each |
startLocation |
The start location of this leg. This might be different from the provided |
endLocation |
The end location of this leg. This might be different from the provided |
steps[] |
An array of steps denoting segments within this leg. Each step represents one navigation instruction. |
travelAdvisory |
Encapsulates the additional information that the user should be informed about, such as possible traffic zone restriction etc. on a route leg. |
Polyline
Encapsulates an encoded polyline.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field polyline_type . Encapsulates the type of polyline. Defaults to encoded_polyline. polyline_type can be only one of the following: |
|
encodedPolyline |
The string encoding of the polyline using the polyline encoding algorithm |
geoJsonLinestring |
Specifies a polyline using the GeoJSON LineString format |
RouteLegStep
Encapsulates a segment of a RouteLeg
. A step corresponds to a single navigation instruction. Route legs are made up of steps.
JSON representation |
---|
{ "distanceMeters": integer, "staticDuration": string, "polyline": { object ( |
Fields | |
---|---|
distanceMeters |
The travel distance of this step, in meters. In some circumstances, this field might not have a value. |
staticDuration |
The duration of travel through this step without taking traffic conditions into consideration. In some circumstances, this field might not have a value. A duration in seconds with up to nine fractional digits, ending with ' |
polyline |
The polyline associated with this step. |
startLocation |
The start location of this step. |
endLocation |
The end location of this step. |
navigationInstruction |
Navigation instructions. |
travelAdvisory |
Encapsulates the additional information that the user should be informed about, such as possible traffic zone restriction on a leg step. |
NavigationInstruction
JSON representation |
---|
{
"maneuver": enum ( |
Fields | |
---|---|
maneuver |
Encapsulates the navigation instructions for the current step (e.g., turn left, merge, straight, etc.). This field determines which icon to display. |
instructions |
Instructions for navigating this step. |
RouteLegStepTravelAdvisory
Encapsulates the additional information that the user should be informed about, such as possible traffic zone restriction on a leg step.
JSON representation |
---|
{
"speedReadingIntervals": [
{
object ( |
Fields | |
---|---|
speedReadingIntervals[] |
Speed reading intervals detailing traffic density. Applicable in case of Example:
|
RouteLegTravelAdvisory
Encapsulates the additional information that the user should be informed about, such as possible traffic zone restriction etc. on a route leg.
JSON representation |
---|
{ "tollInfo": { object ( |
Fields | |
---|---|
tollInfo |
Encapsulates information about tolls on the specific RouteLeg. This field is only populated if we expect there are tolls on the RouteLeg. If this field is set but the estimatedPrice subfield is not populated, we expect that road contains tolls but we do not know an estimated price. If this field does not exist, then there is no toll on the RouteLeg. |
speedReadingIntervals[] |
Speed reading intervals detailing traffic density. Applicable in case of Example:
|