BingRouteOptions.RouteOptimization Property
Gets or sets a value that defines how to optimize the route calculation.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
BingRouteOptimization | A BingRouteOptimization enumeration value. |
Available values:
Name | Description |
---|---|
MinimizeTime | A route is calculated in such a way that the time required to follow this route will be the minimum possible. |
MinimizeDistance | A route is calculated in such a way that its total distance will be the minimum possible. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to RouteOptimization |
---|---|
BingRouteDataProvider |
|
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-get-routes-to-the-destination-point-using-the-bing-map-route-data-service-e4250.
<ObjectDataProvider x:Key="RouteOptimizationValues"
ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="dxm:BingRouteOptimization"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<dxm:InformationLayer EnableHighlighting="False" EnableSelection="False">
<dxm:InformationLayer.DataProvider>
<dxm:BingRouteDataProvider x:Name="routeProvider"
BingKey="{Binding Source={StaticResource bingKey}}"
RouteCalculated="routeDataProvider_RouteCalculated">
<dxm:BingRouteDataProvider.RouteStrokeStyle>
<dxm:StrokeStyle Thickness="10" DashCap="Round"
StartLineCap="Round" EndLineCap="Round" />
</dxm:BingRouteDataProvider.RouteStrokeStyle>
<dxm:BingRouteDataProvider.RouteOptions>
<dxm:BingRouteOptions
Mode="{Binding ElementName=lbMode, Path=SelectedValue}"
RouteOptimization="{Binding ElementName=lbRouteOptimization, Path=SelectedValue}"/>
</dxm:BingRouteDataProvider.RouteOptions>
</dxm:BingRouteDataProvider>
</dxm:InformationLayer.DataProvider>
</dxm:InformationLayer>
<ListBox x:Name="lbRouteOptimization" Margin="4,2,4,2" SelectedIndex="0"
ItemsSource="{Binding Source={StaticResource RouteOptimizationValues}}"/>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RouteOptimization property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.