Aracılığıyla paylaş


MapsRoutingClient.GetDirectionsAsync Method

Definition

Returns a route between an origin and a destination, passing through waypoints if they are specified. The route will take into account factors such as current traffic and the typical road speeds on the requested day of the week and time of day. Information returned includes the distance, estimated travel time, and a representation of the route geometry. Additional routing information such as optimized waypoint order or turn by turn instructions is also available, depending on the options selected. Routing service provides a set of parameters for a detailed description of vehicle-specific Consumption Model. Please check Consumption Model for detailed explanation of the concepts and parameters involved.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Routing.Models.RouteDirections>> GetDirectionsAsync (Azure.Maps.Routing.RouteDirectionQuery query, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDirectionsAsync : Azure.Maps.Routing.RouteDirectionQuery * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Routing.Models.RouteDirections>>
override this.GetDirectionsAsync : Azure.Maps.Routing.RouteDirectionQuery * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Routing.Models.RouteDirections>>
Public Overridable Function GetDirectionsAsync (query As RouteDirectionQuery, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of RouteDirections))

Parameters

query
RouteDirectionQuery

The route direction query, including a list of route points and route direction options.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

query is null.

Service returned a non-success status code.

Applies to