public class DirectionsStep
extends java.lang.Object
DirectionsLeg
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.
When using the Directions API to search for transit directions, the steps array will include
additional
Transit Details in the form of a transitDetails
array. If the directions include
multiple modes of transportation, detailed directions will be provided for walking or driving
steps in a subSteps
array. For example, a walking step will include directions from
the start and end locations: "Walk to Innes Ave & Fitch St". That step will include detailed
walking directions for that route in the subSteps
array, such as: "Head north-west",
"Turn left onto Arelious Walker", and "Turn left onto Innes Ave".
Modifier and Type | Field and Description |
---|---|
Distance |
distance
distance contains the distance covered by this step until the next step. |
Duration |
duration
duration contains the typical time required to perform the step, until the next step. |
LatLng |
endLocation
endLocation contains the location of the last point of this step. |
java.lang.String |
htmlInstructions
htmlInstructions contains formatted instructions for this step, presented as an
HTML text string. |
EncodedPolyline |
polyline
polyline is the path of this step. |
LatLng |
startLocation
startLocation contains the location of the starting point of this step. |
DirectionsStep[] |
subSteps
subSteps contains detailed directions for walking or driving steps in transit
directions. |
TravelMode |
travelMode
travelMode is the travel mode of this step. |
Constructor and Description |
---|
DirectionsStep() |
public java.lang.String htmlInstructions
htmlInstructions
contains formatted instructions for this step, presented as an
HTML text string.public Distance distance
distance
contains the distance covered by this step until the next step.public Duration duration
duration
contains the typical time required to perform the step, until the next step.public LatLng startLocation
startLocation
contains the location of the starting point of this step.public LatLng endLocation
endLocation
contains the location of the last point of this step.public DirectionsStep[] subSteps
subSteps
contains detailed directions for walking or driving steps in transit
directions. Substeps are only available when travelMode is set to "transit".public EncodedPolyline polyline
polyline
is the path of this step.public TravelMode travelMode
travelMode
is the travel mode of this step. See
Travel
Modes for more detail.