Page Summary
-
A Route object encapsulates directions between an origin, a destination, and optional intermediate waypoints, providing distance, duration, and step-by-step instructions.
-
Each Route is comprised of one or more RouteLegs, representing segments between waypoints, with details like distance, duration, and a polyline for the path.
-
RouteLegs are further divided into RouteLegSteps, providing turn-by-turn navigation instructions, including maneuvers and textual guidance.
-
A Polyline object represents the path of the route or a segment, encoded using the polyline algorithm or as a GeoJSON LineString.
-
Route and RouteLeg objects may contain TravelAdvisory information, such as tolls or speed reading intervals related to traffic conditions, to enhance user awareness.
- 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- |
distance
|
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 ' |
static
|
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 is 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. |
travel
|
Additional information about the route. |
optimized
|
If |
RouteLeg
Encapsulates a segment between non- via
waypoints.
| JSON representation |
|---|
{ "distanceMeters" : integer , "duration" : string , "staticDuration" : string , "polyline" : { object ( |
| Fields | |
|---|---|
distance
|
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 ' |
static
|
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 |
start
|
The start location of this leg. This might be different from the provided |
end
|
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. |
travel
|
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 |
polyline_type
. Encapsulates the type of polyline. Defaults to encoded_polyline. polyline_type
can be only one of the following:encoded
Polyline
string
The string encoding of the polyline using the polyline encoding algorithm .
geo
Json
Linestring
object (
Struct
format)
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 | |
|---|---|
distance
|
The travel distance of this step, in meters. In some circumstances, this field might not have a value. |
static
|
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. |
start
|
The start location of this step. |
end
|
The end location of this step. |
navigation
|
Navigation instructions. |
travel
|
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 (for example, turn left, merge, or straight). 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 | |
|---|---|
speed
|
NOTE: This field is not currently populated. |
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 | |
|---|---|
toll
|
Encapsulates information about tolls on the specific |
speed
|
Speed reading intervals detailing traffic density. Applicable in case of Example:
|

