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

OpenStreetMapProvider

RadMap can visualize data from the OpenStreetMaps REST services. You can enable tile caching to a local folder setting a new LocalFileCacheProvider to the OpenStreetMapProvider.CacheProvider property.

Figure 1: OpenStreetMapProvider

map-openstreetmapprovider 001

Using OpenStreetMapProvider

string cacheFolder = @"..\..\cache";
OpenStreetMapProvider osmProvider = new OpenStreetMapProvider();
MapTileDownloader tileDownloader = osmProvider.TileDownloader as MapTileDownloader;
tileDownloader.WebHeaders.Add(System.Net.HttpRequestHeader.UserAgent, "your application name");
LocalFileCacheProvider cache = new LocalFileCacheProvider(cacheFolder);
osmProvider.CacheProvider = cache;
this.radMap1.MapElement.Providers.Add(osmProvider);

Dim cacheFolder As String = "..\..\cache"
Dim osmProvider As New OpenStreetMapProvider()
Dim tileDownloader As MapTileDownloader = TryCast(osmProvider.TileDownloader, MapTileDownloader)
tileDownloader.WebHeaders.Add(System.Net.HttpRequestHeader.UserAgent, "your application name")
Dim cache As New LocalFileCacheProvider(cacheFolder)
osmProvider.CacheProvider = cache
Me.radMap1.MapElement.Providers.Add(osmProvider)

In this article
Not finding the help you need? Improve this article