Skip to main content

How to: Load Image Tiles from OpenStreetMap

Tip

A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/e3617/how-to-connect-to-openstreetmap.

This example demonstrates how to connect to the OpenStreetMap web service using the OpenStreetMapDataProvider object.

<dxm:MapControl>
    <dxm:MapControl.Layers>
        <dxm:ImageLayer>
            <dxm:ImageLayer.DataProvider>
                <dxm:OpenStreetMapDataProvider TileUriTemplate="http://{subdomain}.tile.MyCustomOSMProvider.org/{tileLevel}/{tileX}/{tileY}.png"
                                               WebRequest="OnWebRequest"/>
            </dxm:ImageLayer.DataProvider>
        </dxm:ImageLayer>
    </dxm:MapControl.Layers>
</dxm:MapControl>
See Also