Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AzureTrafficIncidentDataProvider.RequestTrafficIncidents(SearchBoundingBox, Int32, Int32, AzureTrafficIncidentOptions) Method

Requests incidents for the specified region.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public void RequestTrafficIncidents(
    SearchBoundingBox boundingBox,
    int boundingZoom,
    int trafficModelId,
    AzureTrafficIncidentOptions options
)

#Parameters

Name Type Description
boundingBox SearchBoundingBox

Limits the area for the traffic incident request.

boundingZoom Int32

Zoom level for the desired tile. Specify 0 to 22 for raster and vector tiles.

trafficModelId Int32

A number referencing traffic model that is valid for two minutes. A value of -1 always invokes the most recent traffic model.

options AzureTrafficIncidentOptions

An AzureTrafficIncidentOptions object that defines incident request parameters.

#Remarks

Call the provider’s RequestTrafficIncidents method to receive a list of incidents. The AzureRouteOptions parameter allows you to specify traffic incident options.

The following code displays traffic incidents that occurred in the specified area:

using DevExpress.XtraMap;
// ...
const string key = "your key";
AzureTrafficIncidentDataProvider trafficIncidentProvider;
// ...
public Form1() {
    InitializeComponent();
    trafficIncidentProvider = new AzureTrafficIncidentDataProvider {
        AzureKey = key 
    };
    imageLayer2.DataProvider = new AzureMapDataProvider() {
        AzureKey = key,
        Tileset = AzureTileset.BaseHybridRoad
    };
    imageLayer1.DataProvider = new AzureMapDataProvider() {
        AzureKey = key,
        Tileset = AzureTileset.Imagery,
    };
    informationLayer1.DataProvider = trafficIncidentProvider;  
    trafficIncidentProvider.RequestTrafficIncidents(new SearchBoundingBox(-115.338457, 36.268745, 
      -114.988268, 36.1010376), 18, -1,
      new AzureTrafficIncidentOptions {
          OriginalPosition = false,
          IncidentGeometryType = AzureTrafficIncidentGeometryType.Shifted
      });
}
See Also