windowsforms-devexpress-dot-xtramap-13da7bed.md
Allows you to use the Azure Maps service to calculate an isochrone and display it on the map.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public class AzureRouteIsochroneDataProvider :
AzureMapDataProviderBase
Public Class AzureRouteIsochroneDataProvider
Inherits AzureMapDataProviderBase
The AzureRouteIsochroneDataProvider implements the Azure Maps service. Assign such an object to the InformationLayer.DataProvider property to enable the service and display an isochrone (an area around an origin point). You can calculate the area based on travel time or distance.
Azure Maps services support JSON response formats. Install the System.Text.Json package in projects that target .NET Framework to parse the Azure server response and display information on a DevExpress Map control.
Call one of the AzureRouteIsochroneDataProvider.CalculateIsochroneByDistance method overloads to calculate an isochrone based on travel distance.
Call one of the AzureRouteIsochroneDataProvider.CalculateIsochroneByTime method overloads to calculate an isochrone based on travel time.
When you call CalculateIsochroneByTime or CalculateIsochroneByDistance methods, use the AzureRouteIsochroneOptions parameter to specify route options.
The following settings are available:
AzureRouteIsochroneOptions.AvoidTypesExcludes specified road or transportation types from the route.AzureRouteIsochroneOptions.ExtendedRouteDefinitionsSpecifies additional route calculation parameters (definitions).AzureRouteIsochroneOptions.TravelModeSpecifies the transportation / commute mode.
The following example calculates and plots an isochrone. The code sets the origin point and travel distance limit (10 km).
using DevExpress.XtraMap;
// ...
AzureRouteIsochroneDataProvider azureRoute;
const string azureKey = "your key";
// ...
public Form1() {
InitializeComponent();
imageLayer1.DataProvider = new AzureMapDataProvider() {
AzureKey = azureKey,
Tileset = AzureTileset.Imagery,
};
imageLayer2.DataProvider = new AzureMapDataProvider() {
AzureKey = azureKey,
Tileset = AzureTileset.BaseHybridRoad,
};
azureRoute = new AzureRouteIsochroneDataProvider {
AzureKey = azureKey,
};
informationLayer1.DataProvider = azureRoute;
GeoPoint origin = new GeoPoint(36.1532403246368, -86.7701703811725);
azureRoute.CalculateIsochroneByDistance(new RouteWaypoint("", origin), 10000,
new AzureRouteIsochroneOptions { AvoidTypes = AzureRouteAvoidType.Motorways });
mapControl1.SetCenterPoint(origin, false);
mapControl1.Zoom(11);
}
Imports DevExpress.XtraMap
' ...
Private azureRoute As AzureRouteIsochroneDataProvider
Private Const azureKey As String = "your key"
' ...
Public Sub New()
InitializeComponent()
imageLayer1.DataProvider = New AzureMapDataProvider() With {
.AzureKey = azureKey,
.Tileset = AzureTileset.Imagery
}
imageLayer2.DataProvider = New AzureMapDataProvider() With {
.AzureKey = azureKey,
.Tileset = AzureTileset.BaseHybridRoad
}
azureRoute = New AzureRouteIsochroneDataProvider With {.AzureKey = azureKey}
informationLayer1.DataProvider = azureRoute
Dim origin As New GeoPoint(36.1532403246368, -86.7701703811725)
azureRoute.CalculateIsochroneByDistance(New RouteWaypoint("", origin), 10000, New AzureRouteIsochroneOptions With {.AvoidTypes = AzureRouteAvoidType.Motorways})
mapControl1.SetCenterPoint(origin, False)
mapControl1.Zoom(11)
End Sub
Object InformationDataProviderBase WebInformationDataProvider AzureMapDataProviderBase AzureRouteIsochroneDataProvider
See Also