AzureRouteOptions.CustomParameters Property
Specifies additional route definitions.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v24.2.dll
NuGet Package: DevExpress.Win.Map
Declaration
Property Value
Type | Default | Description |
---|---|---|
Dictionary<String, String> | null | 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:
using DevExpress.XtraMap;
// ...
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