Edit this page

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 BingRestMapProvdider 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.

[XAML] 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>

[C#] Example 2: Defining BingRestMapProvider programmaticaly

BingRestMapProvider bingMap = new BingRestMapProvider( MapMode.Aerial, true, "Bing_Map_Key" );
this.radMap.Provider = bingMap;

[VB.NET] Example 3: Defining BingRestMapProvider programmaticaly

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

Here is a snapshot of the map that appears:
Rad Map Features Rest Providers 01

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

Rad Map Features Rest Providers 01 nolabels

Road Mode

The Road mode of Bing Maps ignores the IsLabelVisible property. For this mode the labels are displayed always.

Here is an example of the Road Mode definition:

[XAML] Example 4: Setting Road mode in XAML

<telerik:RadMap x:Name="radMap" ZoomLevel="1">
    <telerik:RadMap.Provider>
        <telerik:BingRestMapProvider ApplicationId="Bing_Map_Key" Mode="Road" IsLabelVisible="True"/>
    </telerik:RadMap.Provider>
</telerik:RadMap>

[C#] Example 5: Setting Road mode programmaticaly

BingRestMapProvider bingMap = new BingRestMapProvider( MapMode.Road, true, "key" );
this.radMap.Provider = bingMap;

[VB.NET] Example 5: Setting Road mode programmaticaly

Dim bingMap As New BingRestMapProvider(MapMode.Road, True, "key")
Me.radMap.Provider = bingMap

Here is a snapshot of the Road mode for Bing Map Rest Provider:

Rad Map Features Providers Bing Map Road

Birdseye Mode

The Bing Map Rest Provider also supports the Birdseye mode. This mode can be used for high resolution levels only (zoom level 19-20)

The Birdseye mode does not provide the tile images for all regions around the world. Some regions have not images for Birdseye mode.

Here is an example of the Birdseye Mode definition:

[XAML] Example 6: Setting Birdseye mode in XAML

<telerik:RadMap x:Name="radMap" ZoomLevel="1">
    <telerik:RadMap.Provider>
        <telerik:BingRestMapProvider ApplicationId="Bing_Map_Key" Mode="Birdseye" IsLabelVisible="True"/>
    </telerik:RadMap.Provider>
</telerik:RadMap>

[C#] Example 7: Setting Birdseye mode programmaticaly

BingRestMapProvider bingMap = new BingRestMapProvider( MapMode.Birdseye, true, "key" );
this.radMap.Provider = bingMap;

[VB.NET] Example 7: Setting Birdseye mode programmaticaly

Dim bingMap As New BingRestMapProvider(MapMode.Birdseye, True, "key")
Me.radMap.Provider = bingMap

Here is a snapshot of the Birdseye mode for Bing Map Rest Provider:

Rad Map Features Providers Bing Map Birdseye

See Also