BingGeocodeDataProvider Class
The class that is used to send requests to the Bing Maps Geocode service.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
Remarks
The Bing Geocode Data provider is represented by the BingGeocodeDataProvider object that can be accessed via the InformationLayer.DataProvider property.
If you wish to specify the number of requested results displayed, use the InformationDataProviderBase.MaxVisibleResultCount property.
Example
This example demonstrates how to provide the capability for end-users to search an address associated with a specified location on a map and get detailed information about this place in the pushpin’s tooltip, utilizing the Bing Geocode web service. Do this as follows:.
- Create an InformationLayer object and add it to the MapControl.Layers collection.
- Create a BingGeocodeDataProvider object, specify its properties and assign it to the InformationLayer.DataProvider property.
Note
Refer to How to: Get a Bing Maps Key if you run the application and see a window with the following error message: “The specified Bing Maps key is invalid. To create a developer account, refer to https://www.microsoft.com/en-us/maps/create-a-bing-maps-key“.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-connect-the-map-control-to-a-ms-bing-geocode-web-service-e5060
using DevExpress.XtraMap;
using System.Windows.Forms;
namespace GeocodeProvider {
public partial class Form1 : Form {
const string bingKey = "YOUR BING KEY HERE";
InformationLayer GeocodeLayer {
get {
return (InformationLayer)mapControl1.Layers["GeocodeLayer"];
}
}
public Form1() {
InitializeComponent();
GeocodeLayer.DataProvider = new BingGeocodeDataProvider() {
BingKey = bingKey,
MaxVisibleResultCount = 1
};
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the BingGeocodeDataProvider class.
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.