Class LocalMapProvider
Provides map tiles from local file system storage using customizable directory structure and file naming patterns for offline mapping.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public class LocalMapProvider : IMapProvider, ICloneable, IMapTileProvider
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.
Declaration
public LocalMapProvider(string directoryPath, string fileFormat)
Parameters
|
System.String
directoryPath
The directory path. |
|
System.String
fileFormat
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
public IMapCacheProvider CacheProvider { get; set; }
Property Value
|
IMapCacheProvider
|
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
|
System.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
public bool EnableCaching { get; set; }
Property Value
|
System.Boolean
|
Implements
FileFormat
Gets or sets the file naming format string used to construct tile file paths from coordinates and zoom level parameters.
Declaration
public virtual string FileFormat { get; set; }
Property Value
|
System.String
|
Id
Gets the unique identifier for this local map provider instance.
Declaration
public virtual string Id { get; }
Property Value
|
System.String
|
Implements
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
|
System.Boolean
|
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
|
System.Int32
|
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
|
System.Int32
|
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
|
System.Drawing.Image
The no image available. |
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
|
IMapTileDownloader
|
Implements
TileSize
Gets or sets the standard tile size in pixels used by this local map provider for all tile operations and rendering.
Declaration
public Size TileSize { get; set; }
Property Value
|
System.Drawing.Size
|
Implements
Methods
Clone()
Creates a shallow copy of this LocalMapProvider instance with all configuration settings and state information.
Declaration
public virtual object Clone()
Returns
|
System.Object
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
|
IMapViewport
viewport
The map viewport defining the visible area and zoom level. |
Returns
|
System.Collections.Generic.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
|
System.Collections.Generic.List<MapViewInfo>
Always returns null since local providers do not support multiple views. |
Implements
GetTileImage(Int32, Int32, Int32)
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
|
System.Int32
x
The tile X coordinate. |
|
System.Int32
y
The tile Y coordinate. |
|
System.Int32
zoom
The zoom level for the tile. |
Returns
|
System.Drawing.Image
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(Int32, Int32, Int32)
Loads a tile image from the local file system using the specified coordinates and zoom level, returning a fallback image if not found.
Declaration
public virtual Image LoadTile(int x, int y, int zoom)
Parameters
|
System.Int32
x
The x. |
|
System.Int32
y
The y. |
|
System.Int32
zoom
The zoom. |
Returns
|
System.Drawing.Image
Image. |
OnInitializationComplete(EventArgs)
Raises the InitializationComplete event to notify subscribers that provider initialization has finished.
Declaration
protected virtual void OnInitializationComplete(EventArgs e)
Parameters
|
System.EventArgs
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
|
InitializationErrorEventArgs
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
|
System.EventArgs
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
|
MapViewInfo
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
|
IMapViewport
viewport
The current map viewport containing zoom level and visible area information. |
|
ViewportChangeAction
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 Type
|
System.EventHandler
|
Implements
InitializationError
Occurs when provider initialization encounters an error during setup.
Declaration
public event InitializationErrorEventHandler InitializationError
Event Type
|
InitializationErrorEventHandler
|
Implements
ProviderUpdated
Occurs when the provider content has been updated with new tile data or configuration changes.
Declaration
public event EventHandler ProviderUpdated
Event Type
|
System.EventHandler
|