ClassLocalMapProvider
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:
public class LocalMapProvider : IMapProvider, ICloneable, IMapTileProvider
Inheritance: objectLocalMapProvider
Implements:
Constructors
LocalMapProvider()
Initializes a new instance of the LocalMapProvider class with default settings and generates a unique identifier.
Declaration
public LocalMapProvider()
LocalMapProvider(string, string)
Initializes a new instance of the LocalMapProvider class with specified directory path and file naming format.
Properties
CacheProvider
Gets or sets the cache provider instance, which is always null for local providers as caching is not applicable.
Declaration
public IMapCacheProvider CacheProvider { get; set; }
Property Value
Implements
DirectoryPath
Gets or sets the root directory path where tile image files are stored in the local file system.
Declaration
public virtual string DirectoryPath { get; set; }
Property Value
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
public bool EnableCaching { get; set; }
Property Value
Implements
FileFormat
Gets or sets the file naming format string used to construct tile file paths from coordinates and zoom level parameters.
Id
Gets the unique identifier for this local map provider instance.
Initialized
Gets or sets a value indicating whether this LocalMapProvider has completed initialization and is ready for tile loading.
Declaration
public bool Initialized { get; protected set; }
Property Value
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
public virtual int MaxZoomLevel { get; set; }
Property Value
Implements
MinZoomLevel
Gets or sets the minimum zoom level supported by this local map provider for tile display and navigation.
Declaration
public virtual int MinZoomLevel { get; set; }
Property Value
Implements
NoImageAvailable
Gets or sets a fallback image displayed when a requested tile file cannot be found or loaded from the local file system.
Declaration
public Image NoImageAvailable { get; set; }
Property Value
The no image available.
Settings
Gets the settings that control tile rendering behavior.
Declaration
public MapTileProviderSettings Settings { get; }
Property Value
Implements
TileDownloader
Gets or sets the tile downloader instance, which is always null for local providers as tiles are loaded from local files.
Declaration
public IMapTileDownloader TileDownloader { get; set; }
Property Value
Implements
Methods
Clone()
Creates a shallow copy of this LocalMapProvider instance with all configuration settings and state information.
Declaration
public virtual object Clone()
Returns
A new LocalMapProvider object that is a copy of this instance.
Implements
GetContent(IMapViewport)
Generates map visual elements for the specified viewport by providing tile images loaded from the local file system.
Declaration
public virtual IEnumerable<MapVisualElement> GetContent(IMapViewport viewport)
Parameters
viewport
The map viewport defining the visible area and zoom level.
Returns
IEnumerable<MapVisualElement>
An enumerable collection of MapVisualElement objects representing local map tiles.
Implements
GetSupportedViews()
Retrieves the list of supported map views, which returns null for local map providers as they do not support multiple views.
Declaration
public virtual List<MapViewInfo> GetSupportedViews()
Returns
List<MapViewInfo>
Always returns null since local providers do not support multiple views.
Implements
GetTileImage(int, int, int)
Retrieves a tile image from the local file system using the specified tile coordinates and zoom level.
Declaration
public Image GetTileImage(int x, int y, int zoom)
Parameters
x
The tile X coordinate.
y
The tile Y coordinate.
zoom
The zoom level for the tile.
Returns
The tile image loaded from local file, or the fallback image if the file does not exist.
Implements
Initialize()
Initializes the local map provider by setting the initialized state and triggering the initialization complete event.
Declaration
public virtual void Initialize()
Implements
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.
OnInitializationComplete(EventArgs)
Raises the InitializationComplete event to notify subscribers that provider initialization has finished.
Declaration
protected virtual void OnInitializationComplete(EventArgs e)
Parameters
e
The event arguments.
OnInitializationError(InitializationErrorEventArgs)
Raises the InitializationError event to notify subscribers that provider initialization has failed.
Declaration
protected virtual void OnInitializationError(InitializationErrorEventArgs e)
Parameters
e
The event arguments containing the initialization error details.
OnProviderUpdated(EventArgs)
Raises the ProviderUpdated event to notify subscribers that provider content has changed.
Declaration
protected virtual void OnProviderUpdated(EventArgs e)
Parameters
e
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
public virtual void SetView(MapViewInfo view)
Parameters
view
The map view information (ignored for local providers).
Implements
ViewportChanged(IMapViewport, ViewportChangeAction)
Responds to viewport changes by calculating visible tiles, loading tile images from local files, and preparing visual elements for rendering.
Declaration
public virtual void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
Parameters
viewport
The current map viewport containing zoom level and visible area information.
action
The type of viewport change that occurred.
Implements
Events
InitializationComplete
Occurs when the local map provider has completed its initialization process and is ready for use.
Declaration
public event EventHandler InitializationComplete
Event Value
Implements
InitializationError
Occurs when provider initialization encounters an error during setup.
Declaration
public event InitializationErrorEventHandler InitializationError
Event Value
Implements
ProviderUpdated
Occurs when the provider content has been updated with new tile data or configuration changes.
Declaration
public event EventHandler ProviderUpdated
Event Value
Implements