Skip to end of metadata
Go to start of metadata

Each element in the legs array specifies a single leg of the journey from the origin to the destination in the calculated route. For routes that contain no waypoints, the route will consist of a single "leg," but for routes that define one or more waypoints, the route will consist of one or more legs, corresponding to the specific legs of the journey.

Definition

public class Leg

Summary

The following table summarizes the members exposed in this class.

Public Constructors

Leg Constructor() Initializes a new instance of the Leg class.

Public Properties

ArrivalTime The time of arrival. Only avaliable when using TravelMode = Transit
DepartureTime The time of departure. Only avaliable when using TravelMode = Transit
Distance distance indicates the total distance covered by this leg
Duration duration indicates the total duration of this leg,
EndAddress end_addresss contains the human-readable address (typically a street address) reflecting the end_location of this leg.
EndLocation end_location contains the latitude/longitude coordinates of the given destination of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, end_location may be different than the provided destination of this leg if, for example, a road is not near the destination.
StartAddress start_address contains the human-readable address (typically a street address) reflecting the start_location of this leg.
StartLocation start_location contains the latitude/longitude coordinates of the origin of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, start_location may be different than the provided origin of this leg if, for example, a road is not near the origin.
Steps steps[] contains an array of steps denoting information about each separate step of the leg of the journey. (See Directions Steps below.)

Public Constructors

public Leg()

Public Properties

public Duration ArrivalTime { get; set; }

The time of arrival. Only avaliable when using TravelMode = Transit

public Duration DepartureTime { get; set; }

The time of departure. Only avaliable when using TravelMode = Transit

public Distance Distance { get; set; }

distance indicates the total distance covered by this leg

public Duration Duration { get; set; }

duration indicates the total duration of this leg,

public string EndAddress { get; set; }

end_addresss contains the human-readable address (typically a street address) reflecting the end_location of this leg.

public Location EndLocation { get; set; }

end_location contains the latitude/longitude coordinates of the given destination of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, end_location may be different than the provided destination of this leg if, for example, a road is not near the destination.

public string StartAddress { get; set; }

start_address contains the human-readable address (typically a street address) reflecting the start_location of this leg.

public Location StartLocation { get; set; }

start_location contains the latitude/longitude coordinates of the origin of this leg. Because the Directions API calculates directions between locations by using the nearest transportation option (usually a road) at the start and end points, start_location may be different than the provided origin of this leg if, for example, a road is not near the origin.

public List<Step> Steps { get; set; }

steps[] contains an array of steps denoting information about each separate step of the leg of the journey. (See Directions Steps below.)

  • No labels