Class
LocalMapProvider

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:

cs-api-definition
public class LocalMapProvider : IMapProvider, ICloneable, IMapTileProvider

Inheritance: objectLocalMapProvider

Implements: ICloneableIMapProviderIMapTileProvider

Constructors

LocalMapProvider()

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

Declaration

cs-api-definition
public LocalMapProvider()

LocalMapProvider(string, string)

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

Declaration

cs-api-definition
public LocalMapProvider(string directoryPath, string fileFormat)

Parameters

directoryPath

string

The directory path.

fileFormat

string

The file format.

Properties

CacheProvider

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

Declaration

cs-api-definition
public IMapCacheProvider CacheProvider { get; set; }

Property Value

IMapCacheProvider

Implements IMapTileProvider.CacheProvider

DirectoryPath

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

Declaration

cs-api-definition
public virtual string DirectoryPath { get; set; }

Property Value

string

EnableCaching

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

Declaration

cs-api-definition
public bool EnableCaching { get; set; }

Property Value

bool

Implements IMapTileProvider.EnableCaching

FileFormat

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

Declaration

cs-api-definition
public virtual string FileFormat { get; set; }

Property Value

string

Id

Gets the unique identifier for this local map provider instance.

Declaration

cs-api-definition
public virtual string Id { get; }

Property Value

string

Implements IMapProvider.Id

Initialized

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

Declaration

cs-api-definition
public bool Initialized { get; protected set; }

Property Value

bool

true if initialized; otherwise, false.

MaxZoomLevel

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

Declaration

cs-api-definition
public virtual int MaxZoomLevel { get; set; }

Property Value

int

Implements IMapProvider.MaxZoomLevel

MinZoomLevel

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

Declaration

cs-api-definition
public virtual int MinZoomLevel { get; set; }

Property Value

int

Implements IMapProvider.MinZoomLevel

NoImageAvailable

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

Declaration

cs-api-definition
public Image NoImageAvailable { get; set; }

Property Value

Image

The no image available.

Settings

Gets the settings that control tile rendering behavior.

Declaration

cs-api-definition
public MapTileProviderSettings Settings { get; }

Property Value

MapTileProviderSettings

Implements IMapTileProvider.Settings

TileDownloader

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

Declaration

cs-api-definition
public IMapTileDownloader TileDownloader { get; set; }

Property Value

IMapTileDownloader

Implements IMapTileProvider.TileDownloader

TileSize

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

Declaration

cs-api-definition
public Size TileSize { get; set; }

Property Value

Size

Implements IMapTileProvider.TileSize

Methods

Clone()

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

Declaration

cs-api-definition
public virtual object Clone()

Returns

object

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

Implements ICloneable.Clone()

GetContent(IMapViewport)

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

Declaration

cs-api-definition
public virtual IEnumerable<MapVisualElement> GetContent(IMapViewport viewport)

Parameters

viewport

IMapViewport

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)

GetSupportedViews()

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

Declaration

cs-api-definition
public virtual List<MapViewInfo> GetSupportedViews()

Returns

List<MapViewInfo>

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

Implements IMapProvider.GetSupportedViews()

GetTileImage(int, int, int)

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

Declaration

cs-api-definition
public Image GetTileImage(int x, int y, int zoom)

Parameters

x

int

The tile X coordinate.

y

int

The tile Y coordinate.

zoom

int

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)

Initialize()

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

Declaration

cs-api-definition
public virtual void Initialize()

Implements IMapProvider.Initialize()

LoadTile(int, int, int)

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

Declaration

cs-api-definition
public virtual Image LoadTile(int x, int y, int zoom)

Parameters

x

int

The x.

y

int

The y.

zoom

int

The zoom.

Returns

Image

Image.

OnInitializationComplete(EventArgs)

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

Declaration

cs-api-definition
protected virtual void OnInitializationComplete(EventArgs e)

Parameters

e

EventArgs

The event arguments.

OnInitializationError(InitializationErrorEventArgs)

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

Declaration

cs-api-definition
protected virtual void OnInitializationError(InitializationErrorEventArgs e)

Parameters

e

InitializationErrorEventArgs

The event arguments containing the initialization error details.

OnProviderUpdated(EventArgs)

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

Declaration

cs-api-definition
protected virtual void OnProviderUpdated(EventArgs e)

Parameters

e

EventArgs

The event arguments.

SetView(MapViewInfo)

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

Declaration

cs-api-definition
public virtual void SetView(MapViewInfo view)

Parameters

view

MapViewInfo

The map view information (ignored for local providers).

Implements IMapProvider.SetView(MapViewInfo)

ViewportChanged(IMapViewport, ViewportChangeAction)

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

Declaration

cs-api-definition
public virtual void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)

Parameters

viewport

IMapViewport

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

action

ViewportChangeAction

The type of viewport change that occurred.

Implements IMapProvider.ViewportChanged(IMapViewport, ViewportChangeAction)

Events

InitializationComplete

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

Declaration

cs-api-definition
public event EventHandler InitializationComplete

Event Value

EventHandler

Implements IMapProvider.InitializationComplete

InitializationError

Occurs when provider initialization encounters an error during setup.

Declaration

cs-api-definition
public event InitializationErrorEventHandler InitializationError

Event Value

InitializationErrorEventHandler

Implements IMapProvider.InitializationError

ProviderUpdated

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

Declaration

cs-api-definition
public event EventHandler ProviderUpdated

Event Value

EventHandler

Implements IMapProvider.ProviderUpdated