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 transit_details array. If the directions include multiple modes of transportation, detailed directions will be provided for walking or driving steps in an inner steps 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 inner steps array, such as: "Head north-west", "Turn left onto Arelious Walker", and "Turn left onto Innes Ave".

interface DirectionsStep {
    distance: Distance;
    duration: Duration;
    end_location: LatLngLiteral;
    html_instructions: string;
    maneuver: Maneuver;
    polyline: {
        points: string;
    };
    start_location: LatLngLiteral;
    steps: DirectionsStep;
    transit_details: TransitDetails;
    travel_mode: TravelMode;
}

Properties

distance: Distance

contains the distance covered by this step until the next step. (See the discussion of this field in Directions Legs)

This field may be undefined if the distance is unknown.

duration: Duration

contains the typical time required to perform the step, until the next step. (See the description in Directions Legs)

This field may be undefined if the duration is unknown

end_location: LatLngLiteral

contains the location of the last point of this step, as a single set of lat and lng fields.

html_instructions: string

contains formatted instructions for this step, presented as an HTML text string.

maneuver: Maneuver

contains the action to take for the current step (turn left, merge, straight, etc.). This field is used to determine which icon to display.

polyline: {
    points: string;
}

contains a single points object that holds an encoded polyline representation of the step. This polyline is an approximate (smoothed) path of the step.

Type declaration

  • points: string
start_location: LatLngLiteral

contains the location of the starting point of this step, as a single set of lat and lng fields.

contains detailed directions for walking or driving steps in transit directions. Substeps are only available when travel_mode is set to "transit". The inner steps array is of the same type as steps.

transit_details: TransitDetails

contains transit specific information. This field is only returned with travel_mode is set to "transit".

travel_mode: TravelMode

contains the type of travel mode used.