Skip to main content
All docs
V24.2

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

Requests incidents for the specified region.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

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