Skip to main content

OpenStreetMapDataProvider.TileUriTemplate Property

Gets or sets a template that is used to obtain image tiles from the current OpenStreetMap provider.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.2.dll

NuGet Package: DevExpress.Wpf.Map

Declaration

public string TileUriTemplate { get; set; }

Property Value

Type Description
String

A String containing the template Uri.

Remarks

Important

Use of this property assumes that an OSM Tile Server is used. This means that all tiles for all zoom levels can be loaded. In a case when not all tiles are available, design a custom tile provider.

Template placeholders will be replaced with the following values on a tile request.

  • {subdomain} - A sub-domain of the OSM server.
  • {tileLevel} - The current zoom level.
  • {tileX} - The horizontal (X) index of the requested tile.
  • {tileY} - The vertical (Y) index of the requested tile.

Note

Before using map images in the OpenStreetMap format, please review the Copyright and License and Tile usage policy pages.

To control which web resource should be used in your application as an OpenStreetMap data provider, you should assign specific values for the OpenStreetMapDataProvider.TileUriTemplate property. Note that by default, this property is set to obtain data from the OpenStreetMap official web service.

Example

The following example demonstrates how to use the OpenStreetMapDataProvider.TileUriTemplate property to obtain image tiles from a custom OpenStreetMap provider.

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map" 
        x:Class="WpfApplication4.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxm:MapControl>
            <dxm:ImageLayer>
                <dxm:ImageLayer.DataProvider>
                    <dxm:OpenStreetMapDataProvider
                        TileUriTemplate="http://{subdomain}.tile.MyCustomOSMProvider.org/{tileLevel}/{tileX}/{tileY}.png"/>
                </dxm:ImageLayer.DataProvider>
            </dxm:ImageLayer>
        </dxm:MapControl>
    </Grid>
</Window>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TileUriTemplate 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.

See Also