New to Telerik UI for WinFormsStart a free 30-day trial

Provides map tiles from local file system storage using customizable directory structure and file naming patterns for offline mapping.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadMap.dll

Syntax:

C#
public class LocalMapProvider : IMapProvider, ICloneable, IMapTileProvider

Inheritance: objectLocalMapProvider

Implements: ICloneableIMapProviderIMapTileProvider

Constructors

Initializes a new instance of the LocalMapProvider class with default settings and generates a unique identifier.

C#
public LocalMapProvider()

Initializes a new instance of the LocalMapProvider class with specified directory path and file naming format.

C#
public LocalMapProvider(string directoryPath, string fileFormat)
Parameters:directoryPathstring

The directory path.

fileFormatstring

The file format.

Properties

Gets or sets the cache provider instance, which is always null for local providers as caching is not applicable.

C#
public IMapCacheProvider CacheProvider { get; set; }

Implements: IMapTileProvider.CacheProvider

Gets or sets the root directory path where tile image files are stored in the local file system.

C#
public virtual string DirectoryPath { get; set; }

Gets or sets a value indicating whether caching is enabled, which is always false for local providers as files are already stored locally.

C#
public bool EnableCaching { get; set; }

Implements: IMapTileProvider.EnableCaching

Gets or sets the file naming format string used to construct tile file paths from coordinates and zoom level parameters.

C#
public virtual string FileFormat { get; set; }

Gets the unique identifier for this local map provider instance.

C#
public virtual string Id { get; }

Implements: IMapProvider.Id

Gets or sets a value indicating whether this LocalMapProvider has completed initialization and is ready for tile loading.

C#
public bool Initialized { get; protected set; }
Property Value:

true if initialized; otherwise, false.

Gets or sets the maximum zoom level supported by this local map provider for tile display and navigation.

C#
public virtual int MaxZoomLevel { get; set; }

Implements: IMapProvider.MaxZoomLevel

Gets or sets the minimum zoom level supported by this local map provider for tile display and navigation.

C#
public virtual int MinZoomLevel { get; set; }

Implements: IMapProvider.MinZoomLevel

Gets or sets a fallback image displayed when a requested tile file cannot be found or loaded from the local file system.

C#
public Image NoImageAvailable { get; set; }
Property Value:

The no image available.

Gets the settings that control tile rendering behavior.

C#
public MapTileProviderSettings Settings { get; }

Implements: IMapTileProvider.Settings

Gets or sets the tile downloader instance, which is always null for local providers as tiles are loaded from local files.

C#
public IMapTileDownloader TileDownloader { get; set; }

Implements: IMapTileProvider.TileDownloader

Gets or sets the standard tile size in pixels used by this local map provider for all tile operations and rendering.

C#
public Size TileSize { get; set; }

Implements: IMapTileProvider.TileSize

Methods

Creates a shallow copy of this LocalMapProvider instance with all configuration settings and state information.

C#
public virtual object Clone()
Returns:

object

A new LocalMapProvider object that is a copy of this instance.

Implements: ICloneable.Clone()

Generates map visual elements for the specified viewport by providing tile images loaded from the local file system.

C#
public virtual IEnumerable<MapVisualElement> GetContent(IMapViewport viewport)
Parameters:viewportIMapViewport

The map viewport defining the visible area and zoom level.

Returns:

IEnumerable<MapVisualElement>

An enumerable collection of MapVisualElement objects representing local map tiles.

Implements: IMapProvider.GetContent(IMapViewport)

Retrieves the list of supported map views, which returns null for local map providers as they do not support multiple views.

C#
public virtual List<MapViewInfo> GetSupportedViews()
Returns:

List<MapViewInfo>

Always returns null since local providers do not support multiple views.

Implements: IMapProvider.GetSupportedViews()

Retrieves a tile image from the local file system using the specified tile coordinates and zoom level.

C#
public Image GetTileImage(int x, int y, int zoom)
Parameters:xint

The tile X coordinate.

yint

The tile Y coordinate.

zoomint

The zoom level for the tile.

Returns:

Image

The tile image loaded from local file, or the fallback image if the file does not exist.

Implements: IMapTileProvider.GetTileImage(int, int, int)

Initializes the local map provider by setting the initialized state and triggering the initialization complete event.

C#
public virtual void Initialize()

Implements: IMapProvider.Initialize()

Loads a tile image from the local file system using the specified coordinates and zoom level, returning a fallback image if not found.

C#
public virtual Image LoadTile(int x, int y, int zoom)
Parameters:xint

The x.

yint

The y.

zoomint

The zoom.

Returns:

Image

Image.

Raises the InitializationComplete event to notify subscribers that provider initialization has finished.

C#
protected virtual void OnInitializationComplete(EventArgs e)
Parameters:eEventArgs

The event arguments.

Raises the InitializationError event to notify subscribers that provider initialization has failed.

C#
protected virtual void OnInitializationError(InitializationErrorEventArgs e)
Parameters:eInitializationErrorEventArgs

The event arguments containing the initialization error details.

Raises the ProviderUpdated event to notify subscribers that provider content has changed.

C#
protected virtual void OnProviderUpdated(EventArgs e)
Parameters:eEventArgs

The event arguments.

Sets the active map view, which has no effect for local map providers as they do not support multiple views.

C#
public virtual void SetView(MapViewInfo view)
Parameters:viewMapViewInfo

The map view information (ignored for local providers).

Implements: IMapProvider.SetView(MapViewInfo)

Responds to viewport changes by calculating visible tiles, loading tile images from local files, and preparing visual elements for rendering.

C#
public virtual void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
Parameters:viewportIMapViewport

The current map viewport containing zoom level and visible area information.

actionViewportChangeAction

The type of viewport change that occurred.

Implements: IMapProvider.ViewportChanged(IMapViewport, ViewportChangeAction)

Events

Occurs when the local map provider has completed its initialization process and is ready for use.

C#
public event EventHandler InitializationComplete

Implements: IMapProvider.InitializationComplete

Occurs when provider initialization encounters an error during setup.

C#
public event InitializationErrorEventHandler InitializationError

Implements: IMapProvider.InitializationError

Occurs when the provider content has been updated with new tile data or configuration changes.

C#
public event EventHandler ProviderUpdated

Implements: IMapProvider.ProviderUpdated