Action
An action specifies what needs to be done at or during a specific portion of the route.
Examples of actions:
- Turn right
- Board a ferry
- You have reached your destination
Actions in a section are divided into actions, pre-actions, and post-actions:
- Pre-actions are performed before the departure of a section.
- Post-actions are performed after the arrival of a section.
- Actions are performed between the departure and arrival of a section.
Clients can also request a separated list of turn-by-turn actions between the departure and arrival of a section. These actions additionally contain road information for each maneuver (e.g. street name and/or house number...) in order to support turn-by-turn guidance.
Road names and language preferences
In certain regions, road names and road numbers are available in more than one language.
You can find road names and numbers in these elements:
- turn-by-turn actions: the attributes
name
and number
of currentRoad
and nextRoad
- spans:
names
and routeNumbers
In both cases, road names and number attributes are arrays, and can contain more than one element. The first element of the array will contain the name (or number) with the highest priority, which is in the preferred language specified by the lang
parameter, if a name in that language is available, or in one of the local languages. For information about supported languages, see languages.
For more information about turn-by-turn actions for the guidance use case, see the turn-by-turn guidance tutorial.
For more information about actions and returning human-readable instructions, see Get instructions.
The following are response bodies with sample actions:
To specify a turn to the left, the response uses the direction
parameter.
"actions": [
...
{
"action": "turn",
"direction": "left",
"duration": 167,
"offset": 85,
"severity": "light"
},
...
]
...
The response can specify charging of an electric vehicle within a postActions
block.
...
"postActions": [
{
"action": "chargingSetup",
"duration": 300
},
{
"action": "charging",
"arrivalCharge": 8.9334,
"consumablePower": 50.0,
"duration": 5045,
"targetCharge": 72.0
}
],
...
The response can specify detailed road information in a turnByTurnActions
block:
...
"turnByTurnActions": [
...T
{
"action": "turn",
"duration": 393,
...
"currentRoad": {
"name": [
{
"value": "Otto-Braun-Straße",
"language": "de"
}
],
"number": [
{
"value": "B2",
"language": "de"
}
]
},
"nextRoad": {
"name": [
{
"value": "Alexanderstraße",
"language": "de"
}
],
"number": [
{
"value": "B2",
"language": "de"
},
{
"value": "B5",
"language": "de"
}
]
}
}
...
]
...