ClassAzureMapProvider
Provides map tiles and search functionality using Microsoft Azure Maps services with configurable tile sets, caching, and localization support.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadMap.dll
Syntax:
public class AzureMapProvider : IMapTileProvider, IMapProvider, ICloneable, IAzureMapSearchProvider, IMapBaseSearchProvider
Inheritance: objectAzureMapProvider
Implements:
Constructors
AzureMapProvider()
Initializes a new instance of the AzureMapProvider class with default settings and configures the Azure tile downloader.
Declaration
public AzureMapProvider()
Fields
Properties
AzureAPIKey
Gets or sets the Azure Maps subscription key used for API authentication and service access.
Declaration
public string AzureAPIKey { get; set; }
Property Value
The azure map key.
AzureAPIVersion
Gets or sets the Azure Maps REST API version string used for service requests and feature compatibility.
Declaration
public string AzureAPIVersion { get; set; }
Property Value
The azure map API version.
CacheProvider
Gets or sets the cache provider instance used for storing and retrieving map tiles from local storage.
Declaration
public IMapCacheProvider CacheProvider { get; set; }
Property Value
Implements
EnableCaching
Gets or sets a value indicating whether tile caching is enabled for storing downloaded tiles locally to improve performance.
Declaration
public bool EnableCaching { get; set; }
Property Value
Implements
Id
Gets the unique identifier for this Azure Maps provider instance.
Initialized
Gets or sets a value indicating whether this AzureMapProvider has completed initialization and is ready for use.
Declaration
public bool Initialized { get; protected set; }
Property Value
true if initialized; otherwise, false.
Initializing
Gets or sets a value indicating whether this AzureMapProvider is currently performing initialization operations.
Declaration
public bool Initializing { get; protected set; }
Property Value
true if initializing; otherwise, false.
LanguageCulture
Gets or sets the culture information used for localizing Azure Maps tiles, search results, and service responses.
Declaration
public CultureInfo LanguageCulture { get; set; }
Property Value
The language culture for map tiles and search results.
MaxZoomLevel
Gets or sets the maximum zoom level supported by this Azure Maps provider for tile requests and map display.
MinZoomLevel
Gets or sets the minimum zoom level supported by this Azure Maps provider for tile requests and map display.
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 responsible for asynchronously downloading map tiles from Azure Maps service.
Declaration
public IMapTileDownloader TileDownloader { get; set; }
Property Value
Implements
TileSetID
Gets or sets the Azure Maps tile set type that determines the visual style and content of map tiles.
Declaration
public AzureTileSet TileSetID { get; set; }
Property Value
Methods
BuildAzureSearchRequestUri(AzureSearchRequest)
Constructs the Azure Maps search request URI based on the search request parameters and selected search mode.
Declaration
protected virtual Uri BuildAzureSearchRequestUri(AzureSearchRequest request)
Parameters
request
The Azure search request containing query parameters and search options.
Returns
The complete URI for the Azure Maps search API request.
Clone()
Creates a deep copy of this AzureMapProvider instance with all configuration settings and state information.
Declaration
public object Clone()
Returns
A new AzureMapProvider object that is a copy of this instance.
Implements
GetCacheKey(int, int, int)
Generates a unique cache key string for storing and retrieving tile images based on coordinates, zoom level, and tile set identifier.
GetContent(IMapViewport)
Generates map visual elements for the specified viewport by converting cached tile images into renderable map tile elements.
Declaration
public 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 map tiles.
Implements
GetSupportedViews()
Retrieves a list of supported map views based on available Azure tile sets with selection state information.
Declaration
public virtual List<MapViewInfo> GetSupportedViews()
Returns
List<MapViewInfo>
A list of MapViewInfo objects representing available Azure Maps tile sets.
Implements
GetTile(int, int, int)
Constructs the URI for retrieving a specific map tile from Azure Maps service using tile matrix coordinates and zoom level.
GetTileImage(int, int, int)
Synchronously retrieves a tile image from Azure Maps service or cache using the specified tile matrix coordinates and zoom level.
Declaration
public Image GetTileImage(int tileMatrixX, int tileMatrixY, int zoomLevel)
Parameters
tileMatrixX
The tile matrix X coordinate.
tileMatrixY
The tile matrix Y coordinate.
zoomLevel
The zoom level for the tile.
Returns
The tile image, or null if the tile cannot be retrieved.
Implements
GetTileInfoImage(TileInfo)
Retrieves the tile image for the specified TileInfo either from cache or by downloading from Azure Maps service.
Declaration
protected virtual void GetTileInfoImage(TileInfo tileInfo)
Parameters
tileInfo
The tile information.
Initialize()
Initializes the Azure Maps provider by verifying service connectivity and preparing the tile matrix for use.
Declaration
public void Initialize()
Implements
OnFileLoadAsyncComplete(string, byte[])
Handles the completion of asynchronous file loading from cache and initiates tile download if cache content is unavailable.
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.
OnSearchCompleted(AzureSearchCompletedEventArgs)
Raises the SearchCompleted event to notify subscribers that a search operation has finished successfully.
Declaration
protected virtual void OnSearchCompleted(AzureSearchCompletedEventArgs e)
Parameters
e
The event arguments containing the search results.
OnSearchError(SearchErrorEventArgs)
Raises the SearchError event to notify subscribers that a search operation has encountered an error.
Declaration
protected virtual void OnSearchError(SearchErrorEventArgs e)
Parameters
e
The event arguments containing the search error details.
OnTileDownloadComplete(object, TileInfoEventArgs)
Handles tile download completion events, manages cache storage, and updates wraparound tiles with downloaded content.
Declaration
protected virtual void OnTileDownloadComplete(object sender, TileInfoEventArgs e)
Parameters
sender
The sender.
e
The TileInfoEventArgs instance containing the event data.
SearchAsync(AzureSearchRequest)
Performs an asynchronous search operation using Azure Maps search services with the specified search request parameters.
Declaration
public void SearchAsync(AzureSearchRequest request)
Parameters
request
The Azure search request containing query text and search options.
Implements
SearchRequest(string)
Processes the JSON search result response from Azure Maps service and deserializes it using multiple encoding strategies.
Declaration
protected virtual void SearchRequest(string searchResult)
Parameters
searchResult
The JSON search result string returned from Azure Maps search service.
SetView(MapViewInfo)
Sets the active map view by configuring the tile set identifier based on the specified view information.
Declaration
public void SetView(MapViewInfo view)
Parameters
view
The map view information containing the desired tile set name.
Implements
ViewportChanged(IMapViewport, ViewportChangeAction)
Responds to viewport changes by calculating visible tiles, managing tile downloads, and updating the tile matrix for rendering.
Declaration
public 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 Azure Maps 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
SearchCompleted
Occurs when an Azure Maps search operation has completed successfully with search results.
Declaration
public event EventHandler<AzureSearchCompletedEventArgs> SearchCompleted
Event Value
Implements
SearchError
Occurs when a search operation encounters an error during execution.
Declaration
public event EventHandler<SearchErrorEventArgs> SearchError
Event Value
Implements