OsmGeocodeDataProvider Class
Provides the capability to obtain geocode data from the Open Street Map service.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
public class OsmGeocodeDataProvider :
WebInformationDataProvider,
IMouseClickRequestSender
Example
This example demonstrates how to add an image layer displaying map tiles from the OSM service and an information layer that searches for a place on the map using the OSM search service. It uses the following classes:
Class | Description |
---|---|
ImageLayer | Displays map images obtained from map image data providers. |
OpenStreetMapDataProvider | The class that loads map images from a web resource that provides data in the OpenStreetMap format. |
InformationLayer | A layer that is used to display additional information above the map. |
OsmGeocodeDataProvider | Provides the capability to obtain geocode data from the Open Street Map service. |
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-use-the-openstreetmap-geocode-service-via-the-map-control-t629683
private void OnFormLoad(object sender, EventArgs e) {
mapControl.Layers.AddRange(new LayerBase[] {
new ImageLayer {
DataProvider = new OpenStreetMapDataProvider() {
TileUriTemplate = "YOUR_TILE_SERVICE.com/{1}/{2}/{3}"
}
},
new InformationLayer {
DataProvider = new OsmGeocodeDataProvider()
}
});
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the OsmGeocodeDataProvider 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.