wpf-devexpress-dot-xpf-dot-map-dot-openstreetmapdataprovider.md
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.v25.2.dll
NuGet Package : DevExpress.Wpf.Map
public string TileUriTemplate { get; set; }
Public Property TileUriTemplate As String
| Type | Description |
|---|---|
| String |
A String containing the template Uri.
|
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.
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.
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.
wpf-map-connect-to-openstreetmap/CS/MainWindow.xaml#L10
<dxm:ImageLayer.DataProvider>
<dxm:OpenStreetMapDataProvider TileUriTemplate="http://{subdomain}.tile.MyCustomOSMProvider.org/{tileLevel}/{tileX}/{tileY}.png"
WebRequest="OnWebRequest"/>
See Also
OpenStreetMapDataProvider Class