# How to Deal with Empty RadMap using BingRestMapProvider

## Environment

| Product Version | Product             | Author                                                                          |
| --------------- | ------------------- | ------------------------------------------------------------------------------- |
| 2022.3.1109     | RadMap for WinForms | [Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova) |

## Description

When using RadMap with the [BingRestMapProvider](https://www.telerik.com/products/winforms/documentation/controls/map/providers/bingmaps/bingrestmapprovider), the map may remain empty.
This article shows how to handle this unexpected behavior and load the map tiles.

## Solution

> important Please note that [Bing Maps](https://www.bingmapsportal.com/) **will be deprecated effective June 30, 2025**. As an alternative, users can refer to the [SDK example available in our GitHub repository](https://github.com/telerik/winforms-sdk/tree/master/Map/Custom%20Azure%20Provider), which demonstrates how to create a **custom provider** using the **Azure Maps API**. A **valid Azure Maps subscription key** is required to use this functionality.

**BingRestMapProvider** internally loads tile data from the [Bing Maps](https://www.bingmapsportal.com/) REST service which requires **TLS 1.2** coming automatically with .NET Framework 4.7. It is necessary to ensure the version explicitly by setting the System.Net.ServicePointManager.**SecurityProtocol** property to SecurityProtocolType.**Tls12**. More information is available here: [Transport Layer Security (TLS) best practices with the .NET Framework](https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls).

```C#

 // How to specify Tls 1.2 for .NET Framework 4.0
 //System.Net.ServicePointManager.SecurityProtocol =(System.Net.SecurityProtocolType)3072;

 System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

 string cacheFolder = @"..\..\cache";

 BingRestMapProvider bingProvider = new Telerik.WinControls.UI.BingRestMapProvider();
 bingProvider.UseSession = true;
 bingProvider.BingKey = bingKey;

 LocalFileCacheProvider cache = new LocalFileCacheProvider(cacheFolder);
 bingProvider.CacheProvider = cache;

 this.radMap1.Providers.Add(bingProvider);     

```

```VB.NET

'How to specify Tls 1.2 for .NET Framework 4.0
'System.Net.ServicePointManager.SecurityProtocol = CType(3072, System.Net.SecurityProtocolType)

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12

Dim cacheFolder As String = "..\..\cache"

Dim bingProvider As BingRestMapProvider = New Telerik.WinControls.UI.BingRestMapProvider()
bingProvider.UseSession = True
bingProvider.BingKey = bingKey

Dim cache As New LocalFileCacheProvider(cacheFolder)
bingProvider.CacheProvider = cache

Me.radMap1.Providers.Add(bingProvider)    

```

## See Also

* [BingRestMapProvider](https://www.telerik.com/products/winforms/documentation/controls/map/providers/bingmaps/bingrestmapprovider)
