New to Telerik UI for WPF? Download free 30-day trial

Open Street Maps Provider

RadMap supports displaying tile data from the Open Street Map services via the OpenStreetMapProvider class. You have the option of passing an API key to it. This key is needed for the Transport and Cycle maps, which come from ThunderForest. You can check the following page in order to learn how to obtain an API key.

OpenStreetMapProvider with API key in Xaml

<telerik:RadMap x:Name="radMap" ZoomLevel="1"> 
    <telerik:RadMap.Provider> 
        <telerik:OpenStreetMapProvider APIKey="your-api-key" /> 
    </telerik:RadMap.Provider> 
</telerik:RadMap> 

OpenStreetMapProvider set in code

OpenStreetMapProvider openStreetMap = new OpenStreetMapProvider("your-api-key"); 
this.radMap.Provider = openStreetMap; 
Dim openStreetMap As New OpenStreetMapProvider("your-api-key") 
Me.radMap.Provider = openStreetMap 

When using the OpenStreetMapProvider, you have to display an attribution copyright label to the Open Street Map services. To learn more about the accurate copyright label's content, please refer to the OpenStreetMap Attribution Guideline article.

To learn how to customize the RadMap to allocate space for displaying an element containing a sample attribution copyright label, check this article.

Setting a User-Agent

The OpenStreetMapProvider class provides the option of passing a User-Agent header, which will be used in the web request for downloading the tiles from the Standard tile layer. This allows for compliance with the OpenStreetMaps Tile Usage Policy.

If a User-Agent is not provided, the Standard layer tiles will not be downloaded.

The following two examples demonstrate how you can pass such a User-Agent.

Setting StandardModeUserAgent in Xaml

<telerik:RadMap x:Name="radMap" ZoomLevel="1"> 
    <telerik:RadMap.Provider> 
        <telerik:OpenStreetMapProvider APIKey="your-api-key" StandardModeUserAgent="your custom user agent string" /> 
    </telerik:RadMap.Provider> 
</telerik:RadMap> 

Setting StandardModeUserAgent in code

OpenStreetMapProvider openStreeMapProvider = new OpenStreetMapProvider("your-api-key") 
{ 
    StandardModeUserAgent = "your custom user agent string" 
}; 
Dim openStreeMapProvider As New OpenStreetMapProvider("your-api-key") With {.StandardModeUserAgent = "your custom user agent string"} 
In this article