Back to Devexpress

AzureRouteOptions.CustomParameters Property

wpf-devexpress-dot-xpf-dot-map-dot-azurerouteoptions-8ed262ac.md

latest2.8 KB
Original Source

AzureRouteOptions.CustomParameters Property

Specifies additional route definitions.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public Dictionary<string, string> CustomParameters { get; set; }
vb
Public Property CustomParameters As Dictionary(Of String, String)

Property Value

TypeDescription
Dictionary<String, String>

The dictionary that stores additional route definitions.

|

Remarks

Use this property to add route instructions and thus adjust route calculation.

The following code snippet allows the Azure Route service to rearrange waypoints passed to the AzureRouteDataProvider.CalculateRoute method to create an optimized route:

csharp
using DevExpress.Xpf.Map;
// ...
const string key = "your key";
// ...
AzureRouteDataProvider routeProvider = new AzureRouteDataProvider();
    routeProvider.AzureKey = key;
List<RouteWaypoint> waypoints = new List<RouteWaypoint>();
waypoints.Add(new RouteWaypoint("NY", new GeoPoint(41.145556, -73.995)));
waypoints.Add(new RouteWaypoint("Oklahoma", new GeoPoint(36.131389, -95.937222)));
waypoints.Add(new RouteWaypoint("Las Vegas", new GeoPoint(36.175, -115.136389)));
// Call the AzureRouteDataProvider.CalculateRoute method.
routeProvider.CalculateRoute(waypoints, new AzureRouteOptions() {
    TravelMode = AzureTravelMode.Car,
    AvoidTypes = AzureRouteAvoidType.None,
    CustomParameters = new Dictionary<string, string>() { { "computeBestOrder", "true" } }
});

See Also

AzureRouteOptions Class

AzureRouteOptions Members

DevExpress.Xpf.Map Namespace