WmsDataProvider.ResponseCapabilities Event
Occurs when a Web Map Service returns the supported capabilities.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v20.1.dll
NuGet Package: DevExpress.Win.Map
Declaration
Event Data
The ResponseCapabilities event's data class is CapabilitiesRespondedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Exception | Gets a thrown exception. |
Layers | Returns a collection of available layers supported by a Web Map Service. |
Example
This example demonstrates how to receive information from a Web Map Service using the WmsDataProvider.ResponseCapabilities
event handler.
To do this, use the CapabilitiesRespondedEventArgs arguments of the event to specify a WMS active layer and obtain the required information.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-obtain-data-on-the-responsecapabilities-event-t359144
using DevExpress.XtraMap;
using System.Windows.Forms;
namespace ResponseCapabilitiesHandler {
public partial class Form1 : Form {
ImageLayer WmsLayer {
get { return (ImageLayer)mapControl.Layers["WmsImageLayer"]; }
}
WmsDataProvider Provider {
get { return WmsLayer.DataProvider as WmsDataProvider; }
}
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, System.EventArgs e) {
// Handle the ResponseCapabilities event.
Provider.ResponseCapabilities += OnResponseCapabalities;
}
void OnResponseCapabalities(object sender, CapabilitiesRespondedEventArgs e) {
// Specify an active layer for the map control.
Provider.ActiveLayerName = e.Layers[0].Name;
// Recieve information on the active layer.
label1.Text = string.Format("Layer name: {0}, Layer title: {1}", e.Layers[0].Name, e.Layers[0].Title);
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ResponseCapabilities 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.