Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OsmSearchDataProvider Class

Provides the search options using the Open Street Map service.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public class OsmSearchDataProvider :
    WebInformationDataProvider,
    ISearchPanelRequestSender

#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.
OsmSearchDataProvider Provides the search options using the Open Street Map service.

View Example

private void OnFormLoad(object sender, EventArgs e) {
    mapControl.Layers.AddRange(new LayerBase[] {
        new ImageLayer {
            DataProvider = new OpenStreetMapDataProvider {
                TileUriTemplate = "YOUR_WEB_SERVICE.com/{1}/{2}/{3}"
            }
        },
        new InformationLayer {
            DataProvider = new OsmSearchDataProvider { }
        }
    });
}
See Also