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

LocalMapProvider

RadMap can visualize data from local image files by using a LocalMapProvider.

Figure 1: LocalMapProvider

WinForms RadMap LocalMapProvider

Using LocalMapProvider


string mapFolder = @"..\..\World";
LocalMapProvider provider = new LocalMapProvider();
provider.DirectoryPath = mapFolder;
provider.FileFormat = "os_{0}_{1}_{2}.png";
provider.MinZoomLevel = 1;
provider.MaxZoomLevel = 9;
radMap1.Providers.Add(provider);

Dim mapFolder As String = "..\..\World"
Dim provider As New LocalMapProvider()
provider.DirectoryPath = mapFolder
provider.FileFormat = "os_{0}_{1}_{2}.png"
provider.MinZoomLevel = 1
provider.MaxZoomLevel = 9
radMap1.Providers.Add(provider)

The FileFormat property specifies what is the exact format of the image files stored in the local folder. The parameters needed are the tile X {0} and Y {1} numbers and the Zoom level {2}. In the code snippet above, each file image's name is built by using x,y,z values: "os_X_Y_Z.png".

Properties

Property Description
DirectoryPath Specifies the folder path.
FileFormat Specifies the file format.
NoImageAvailable Gets or sets an image that will be displayed when a tile image cannot be retrieved or does not exist.
TileSize Gets the tile size.
Initialized Gets or sets a value indicating whether this LocalMapProvider is initialized.

Methods

Method Description
LoadTile Loads the tile image by x,y, zoom.
In this article