windowsforms-devexpress-dot-xtramap-dot-informationdataproviderbase-412c8092.md
Occurs when a data provider starts generating map items for a layer.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public event LayerItemsGeneratingEventHandler LayerItemsGenerating
Public Event LayerItemsGenerating As LayerItemsGeneratingEventHandler
The LayerItemsGenerating event's data class is LayerItemsGeneratingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Cancelled | Gets a value indicating whether an asynchronous operation has been canceled. Inherited from AsyncCompletedEventArgs. |
| Error | Gets a value indicating which error occurred during an asynchronous operation. Inherited from AsyncCompletedEventArgs. |
| Items | Returns all the items generated for the layer. |
| UserState | Gets the unique identifier for the asynchronous task. Inherited from AsyncCompletedEventArgs. |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| RaiseExceptionIfNecessary() | Raises a user-supplied exception if an asynchronous operation failed. Inherited from AsyncCompletedEventArgs. |
void OnLayerItemsGenerating(object sender, LayerItemsGeneratingEventArgs e) {
foreach(MapItem item in e.Items) {
MapPolyline polyline = item as MapPolyline;
if(polyline != null) {
polyline.Stroke = Color.FromArgb(0xFF, 0x00, 0x72, 0xC6);
polyline.StrokeWidth = 4;
}
}
}
Private Sub OnLayerItemsGenerating(ByVal sender As Object, ByVal e As LayerItemsGeneratingEventArgs)
For Each item As MapItem In e.Items
Dim polyline As MapPolyline = TryCast(item, MapPolyline)
If polyline IsNot Nothing Then
polyline.Stroke = Color.FromArgb(&HFF, &H0, &H72, &HC6)
polyline.StrokeWidth = 4
End If
Next item
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the LayerItemsGenerating event.
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.
winforms-map-get-geo-point-info-from-bing-geocode-service/CS/RequestLocationInformation/Form1.cs#L32
geocodeProvider.LocationInformationReceived += OnLocationInformationReceived;
geocodeProvider.LayerItemsGenerating += OnLayerItemsGenerating;
informationLayer.DataProvider = geocodeProvider;
map-for-winforms-azure-geocoding/CS/AzureGeocoding/Form1.cs#L34
geocodeProvider.LocationInformationReceived += OnLocationInformationReceived;
geocodeProvider.LayerItemsGenerating += OnLayerItemsGenerating;
simpleButton1.Click += requestLocation_Click;
winforms-map-get-geo-point-info-from-bing-geocode-service/VB/RequestLocationInformation/Form1.vb#L40
AddHandler geocodeProvider.LocationInformationReceived, AddressOf OnLocationInformationReceived
AddHandler geocodeProvider.LayerItemsGenerating, AddressOf OnLayerItemsGenerating
informationLayer.DataProvider = geocodeProvider
map-for-winforms-azure-geocoding/VB/AzureGeocoding/Form1.vb#L40
AddHandler Me.geocodeProvider.LocationInformationReceived, AddressOf OnLocationInformationReceived
AddHandler Me.geocodeProvider.LayerItemsGenerating, AddressOf OnLayerItemsGenerating
AddHandler Me.simpleButton1.Click, AddressOf requestLocation_Click
See Also
InformationDataProviderBase Class