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

Bing Map Rest Provider

The RadMap control supports visualizing tile data using the Bind Maps Rest imagery service. In order to create an instance of the BingRestMapProvider you have to use the third overload of its constructor. This way you can easily pass the required parameters - map mode, labels visibility and a Bing Maps Key. The most important of them is the Bing Maps Key parameter. Without supplying a valid key you will not be able to visualize the map inside the RadMap control. In order to learn how to obtain one, please read Accessing the Control Using a Bing Maps Key.

The RadMap BingRestMapProvider is based on the Bing Maps Imagery API.

Here is a list of the key properties which are used by BingRestMapProvider:

  • ApplicationId: Gets or sets Bing Maps Key.

  • IsLabelVisible: Gets or sets value which indicates whether labels should be visible on the map.

  • Mode: Gets or sets the mode defining how the map looks. You can choose between Road, Aerial and Birdseye options.

  • UseSession: Gets or sets value which indicates whether Bing session should be used.

If the provider’s initialization fails, the BingRestMapProvider will raise its InitializationFaulted event. The event can be fired for example, when the internet connection is lost or when the service is unavailable. The event arguments are of type InitializationFaultEventArgs type. The arguments provides an Error property which contains the exception which is thrown while initialization.

Example 1: Setting BingRestMapProvider in XAML

<telerik:RadMap> 
    <telerik:RadMap.Provider> 
        <telerik:BingRestMapProvider ApplicationId="Bing_Map_Key" Mode="Aerial" IsLabelVisible="True"/> 
    </telerik:RadMap.Provider> 
</telerik:RadMap> 

Example 2: Defining BingRestMapProvider programmaticaly

BingRestMapProvider bingMap = new BingRestMapProvider( MapMode.Aerial, true, "Bing_Map_Key" ); 
this.radMap.Provider = bingMap; 
Dim bingMap As New BingRestMapProvider(MapMode.Aerial, True, "Bing_Map_Key") 
Me.radMap.Provider = bingMap 

Figure 1: Aerial mode with labels

Rad Map Features Rest Providers 01

You can disable labels using the IsLabelVisible property. When you set it to False the labels disappear. Figure 2 is a snapshot of the Aerial mode for Bing Rest Map Provider when the labels are not visible:

Figure 2: Aerial mode without labels

Rad Map Features Rest Providers 01 nolabels

Language

Bing Rest Service provides culture parameter in its url address. This parameter can be used to specify a culture for your request. To change the current culture of the labels shown on the BingRestMapProvider, the Language property of the RadMap control can be used.

For a list of supported cultures, see Supported Culture Codes.

Example 4: Setting Language of RadMap in XAML

<telerik:RadMap Language="fr-FR"> 
    <telerik:RadMap.Provider> 
        <telerik:BingRestMapProvider ApplicationId="Bing_Map_Key" Mode="Aerial" IsLabelVisible="True"/> 
    </telerik:RadMap.Provider> 
</telerik:RadMap> 

Figure 3: BingRestMapProvider with French culture parameter

Rad Map Language Rest Providers French

See Also

In this article