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

Top Layer

The RadMap control allows you to specify the layer option that will be displayed over the received Bing Maps imagery service. To specify the layer or layers, set the TopLayer property of the BingRestMapProvider instance. This property is of the type BingTopLayer.

The TopLayer property is a flag enumeration and it allows you to specify more than one layer. The options that are exposed by the BingTopLayer enumeration are as follows:

  • Basemap—This option displays the regular road map layer with labels. This option is the default value of the TopLayer property.
  • Background—The Background option shows only base geometry layer without labels. This option does not have effect when the Mode property of the provider is set to Ariel or Road modes.
  • Foreground—The Foreground option displays only a label layer. This option does not have effect when the Mode property of the provider is set to Ariel or Road modes.
  • TrafficFlow—This option shows a traffic flow layer on top of the roads. This option does not have effect when the Mode property of the provider is set to Ariel or Road modes.

Setting the TopLayer property

BingRestMapProvider bingRestMapProvider = new BingRestMapProvider(); 
bingRestMapProvider.ApplicationId = "Bing_Map_Key"; 
bingRestMapProvider.Mode = MapMode.AerialOnDemand; 
bingRestMapProvider.TopLayer = BingTopLayer.TrafficFlow | BingTopLayer.Background; 
 
this.radMap.Provider = bingRestMapProvider; 
Dim bingRestMapProvider As BingRestMapProvider = New BingRestMapProvider() 
bingRestMapProvider.ApplicationId = "Bing_Map_Key" 
bingRestMapProvider.Mode = MapMode.AerialOnDemand 
bingRestMapProvider.TopLayer = BingTopLayer.TrafficFlow Or BingTopLayer.Background 
 
Me.radMap.Provider = bingRestMapProvider 

RadMap with TopLayer property set to BingTopLayer.TrafficFlow and BingTopLayer.Background

RadMap with TopLayer property set to BingTopLayer.TrafficFlow and BingTopLayer.Background

Modifying the values of the TopLayer property at runtime is not fully supported. To change them during runtime, create a new instance of the BingRestMapProvider class and set the new values to the TopLayer property.

The following scenarios of the TopLayer options are not supported:

  • Basemap and Background
  • Basemap and Foreground
  • Buildings option

See Also

In this article