windowsforms-devexpress-dot-xtramap-dot-informationlayer.md
Provides access to an object that obtains information data from online data providers.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
[DefaultValue(null)]
public InformationDataProviderBase DataProvider { get; set; }
<DefaultValue(Nothing)>
Public Property DataProvider As InformationDataProviderBase
| Type | Default | Description |
|---|---|---|
| InformationDataProviderBase | null |
An InformationDataProviderBase class descendant that is a specific data provider.
|
For more information, refer to Map Image Data.
This example demonstrates how to allow users to search for a specific place on a map using the Search panel.
To enable searching in the map control, do the following.
BingSearchDataProvider and assign it to the InformationLayer.DataProvider property.BingMapDataProvider.BingKey property.The Search panel appears automatically (since the MapSearchPanelOptions.Visible property value is true by default).
using DevExpress.XtraMap;
using System.Windows.Forms;
namespace ConnectBingSearchProvider {
public partial class Form1 : Form {
const string bingKey = "YOUR BING KEY HERE";
InformationLayer SearchLayer {
get {
return (InformationLayer)mapControl1.Layers["SearchLayer"];
}
}
public Form1() {
InitializeComponent();
BingSearchDataProvider searchProvider = new BingSearchDataProvider() {
BingKey = bingKey
};
searchProvider.SearchOptions.ResultsCount = 5;
SearchLayer.DataProvider = searchProvider;
}
}
}
Imports DevExpress.XtraMap
Imports System.Windows.Forms
Namespace ConnectBingSearchProvider
Partial Public Class Form1
Inherits Form
Private Const bingKey As String = "YOUR BING KEY HERE"
Private ReadOnly Property SearchLayer() As InformationLayer
Get
Return CType(mapControl1.Layers("SearchLayer"), InformationLayer)
End Get
End Property
Public Sub New()
InitializeComponent()
Dim searchProvider As New BingSearchDataProvider() With {.BingKey = bingKey}
searchProvider.SearchOptions.ResultsCount = 5
SearchLayer.DataProvider = searchProvider
End Sub
End Class
End Namespace
The following code snippets (auto-collected from DevExpress Examples) contain references to the DataProvider property.
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#L33
geocodeProvider.LayerItemsGenerating += OnLayerItemsGenerating;
informationLayer.DataProvider = geocodeProvider;
#endregion #CreateGeocodeProvider
searchProvider = new BingSearchDataProvider();
infoLayer.DataProvider = searchProvider;
searchProvider.GenerateLayerItems = false;
winforms-map-use-openstreetmap-search-service/CS/OsmSearchSample/MainForm.cs#L22
osmSearchDataProvider.ResultsCount = 5;
infoLayer.DataProvider = osmSearchDataProvider;
map-for-winforms-azure-geocoding/CS/AzureGeocoding/Form1.cs#L36
simpleButton1.Click += requestLocation_Click;
informationLayer.DataProvider = geocodeProvider;
imageLayer.DataProvider = imageProvider;
winforms-map-get-geo-point-info-from-bing-geocode-service/VB/RequestLocationInformation/Form1.vb#L41
AddHandler geocodeProvider.LayerItemsGenerating, AddressOf OnLayerItemsGenerating
informationLayer.DataProvider = geocodeProvider
#End Region ' #CreateGeocodeProvider
searchProvider = New BingSearchDataProvider()
infoLayer.DataProvider = searchProvider
searchProvider.GenerateLayerItems = False
map-for-winforms-azure-routing/VB/Form1.vb#L32
azureRoute = New AzureRouteDataProvider() With {.AzureKey = azureKey}
routeInfoLayer.DataProvider = azureRoute
itemData = New MapItemStorage()
map-for-winforms-azure-geocoding/VB/AzureGeocoding/Form1.vb#L42
AddHandler Me.simpleButton1.Click, AddressOf requestLocation_Click
informationLayer.DataProvider = geocodeProvider
imageLayer.DataProvider = imageProvider
See Also