Class Leg
- Namespace
- GoogleMapsApi.Entities.Directions.Response
- Assembly
- GoogleMapsApi.dll
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.
public class Leg
- Inheritance
-
Leg
- Inherited Members
Properties
ArrivalTime
The time of arrival. Only avaliable when using TravelMode = Transit
[JsonPropertyName("arrival_time")]
public Duration? ArrivalTime { get; set; }
Property Value
DepartureTime
The time of departure. Only avaliable when using TravelMode = Transit
[JsonPropertyName("departure_time")]
public Duration? DepartureTime { get; set; }
Property Value
Distance
distance indicates the total distance covered by this leg
[JsonPropertyName("distance")]
public Distance? Distance { get; set; }
Property Value
Duration
duration indicates the total duration of this leg,
[JsonPropertyName("duration")]
public Duration? Duration { get; set; }
Property Value
DurationInTraffic
duration_in_traffic indicates the total duration of this leg. This value is an estimate of the time in traffic based on current and historical traffic conditions.
[JsonPropertyName("duration_in_traffic")]
public Duration? DurationInTraffic { get; set; }
Property Value
EndAddress
end_addresss contains the human-readable address (typically a street address) reflecting the end_location of this leg.
[JsonPropertyName("end_address")]
public string? EndAddress { get; set; }
Property Value
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.
[JsonPropertyName("end_location")]
public Location? EndLocation { get; set; }
Property Value
StartAddress
start_address contains the human-readable address (typically a street address) reflecting the start_location of this leg.
[JsonPropertyName("start_address")]
public string? StartAddress { get; set; }
Property Value
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.
[JsonPropertyName("start_location")]
public Location? StartLocation { get; set; }
Property Value
Steps
steps[] contains an array of steps denoting information about each separate step of the leg of the journey. (See Directions Steps below.)
[JsonPropertyName("steps")]
public IEnumerable<Step>? Steps { get; set; }