Class Route
Contains a route, which consists of a series of connected road segments that join beginning, ending, and intermediate waypoints.
Namespace: Google.Maps.Routing.V2
Assembly: Google.Maps.Routing.V2.dll
Syntax
public sealed class Route : IMessage<Route>, IEquatable<Route>, IDeepCloneable<Route>, IBufferMessage, IMessage
Constructors
Route()
Declaration
public Route()
Route(Route)
Declaration
public Route(Route other)
Parameters
| Type | Name | Description |
|---|---|---|
| Route | other |
Properties
Description
A description of the route.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DistanceMeters
The travel distance of the route, in meters.
Declaration
public int DistanceMeters { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Duration
The length of time needed to navigate the route. If you set the
routing_preference to TRAFFIC_UNAWARE, then this value is the same as
static_duration. If you set the routing_preference to either
TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL, then this value is calculated
taking traffic conditions into account.
Declaration
public Duration Duration { get; set; }
Property Value
| Type | Description |
|---|---|
| Duration |
Legs
A collection of legs (path segments between waypoints) that make up the
route. Each leg corresponds to the trip between two non-via
[Waypoints][google.maps.routing.v2.Waypoint]. For example, a route with
no intermediate waypoints has only one leg. A route that includes one
non-via intermediate waypoint has two legs. A route that includes one
via intermediate waypoint has one leg. The order of the legs matches the
order of waypoints from origin to intermediates to destination.
Declaration
public RepeatedField<RouteLeg> Legs { get; }
Property Value
| Type | Description |
|---|---|
| RepeatedField<RouteLeg> |
LocalizedValues
Text representations of properties of the Route.
Declaration
public Route.Types.RouteLocalizedValues LocalizedValues { get; set; }
Property Value
| Type | Description |
|---|---|
| Route.Types.RouteLocalizedValues |
OptimizedIntermediateWaypointIndex
If you set
[optimize_waypoint_order][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order]
to true, this field contains the optimized ordering of intermediate
waypoints. Otherwise, this field is empty.
For example, if you give an input of Origin: LA; Intermediate waypoints:
Dallas, Bangor, Phoenix; Destination: New York; and the optimized
intermediate waypoint order is Phoenix, Dallas, Bangor, then this field
contains the values [2, 0, 1]. The index starts with 0 for the first
intermediate waypoint provided in the input.
Declaration
public RepeatedField<int> OptimizedIntermediateWaypointIndex { get; }
Property Value
| Type | Description |
|---|---|
| RepeatedField<int> |
Polyline
The overall route polyline. This polyline is the combined polyline of
all legs.
Declaration
public Polyline Polyline { get; set; }
Property Value
| Type | Description |
|---|---|
| Polyline |
PolylineDetails
Contains information about details along the polyline.
Declaration
public PolylineDetails PolylineDetails { get; set; }
Property Value
| Type | Description |
|---|---|
| PolylineDetails |
RouteLabels
Labels for the Route that are useful to identify specific properties
of the route to compare against others.
Declaration
public RepeatedField<RouteLabel> RouteLabels { get; }
Property Value
| Type | Description |
|---|---|
| RepeatedField<RouteLabel> |
RouteToken
An opaque token that can be passed to Navigation SDK to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route.
NOTE: Route.route_token is only available for requests that have set
ComputeRoutesRequest.routing_preference to TRAFFIC_AWARE or
TRAFFIC_AWARE_OPTIMAL. Route.route_token is not supported for requests
that have Via waypoints.
Declaration
public string RouteToken { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
StaticDuration
The duration of travel through the route without taking traffic conditions into consideration.
Declaration
public Duration StaticDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| Duration |
TravelAdvisory
Additional information about the route.
Declaration
public RouteTravelAdvisory TravelAdvisory { get; set; }
Property Value
| Type | Description |
|---|---|
| RouteTravelAdvisory |
Viewport
The viewport bounding box of the polyline.
Declaration
public Viewport Viewport { get; set; }
Property Value
| Type | Description |
|---|---|
| Viewport |
Warnings
An array of warnings to show when displaying the route.
Declaration
public RepeatedField<string> Warnings { get; }
Property Value
| Type | Description |
|---|---|
| RepeatedField<string> |