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.v20.1.dll

Declaration

public string TileUriTemplate { get; set; }
Public Property TileUriTemplate As String

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.

  • {0} - A sub-domain of the OSM server.
  • {1} - The current zoom level.
  • {2} - The horizontal (X) index of the requested tile.
  • {3} - 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.

Examples

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://{0}.tile.MyCustomOSMProvider.org/{1}/{2}/{3}.png"/>
                </dxm:ImageLayer.DataProvider>
            </dxm:ImageLayer>
        </dxm:MapControl>
    </Grid>
</Window>
See Also