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

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:

C#
public class AzureMapProvider : IMapTileProvider, IMapProvider, ICloneable, IAzureMapSearchProvider, IMapBaseSearchProvider

Inheritance: objectAzureMapProvider

Implements: IAzureMapSearchProviderICloneableIMapBaseSearchProviderIMapProviderIMapTileProvider

Constructors

Initializes a new instance of the AzureMapProvider class with default settings and configures the Azure tile downloader.

C#
public AzureMapProvider()

Fields

C#
protected Dictionary<string, List<TileInfo>> cacheLoadReference
C#
protected object lockObj
C#
protected Dictionary<string, TileInfo> tileMatrix

Properties

Gets or sets the Azure Maps subscription key used for API authentication and service access.

C#
public string AzureAPIKey { get; set; }
Property Value:

The azure map key.

Gets or sets the Azure Maps REST API version string used for service requests and feature compatibility.

C#
public string AzureAPIVersion { get; set; }
Property Value:

The azure map API version.

Gets or sets the cache provider instance used for storing and retrieving map tiles from local storage.

C#
public IMapCacheProvider CacheProvider { get; set; }

Implements: IMapTileProvider.CacheProvider

Gets or sets a value indicating whether tile caching is enabled for storing downloaded tiles locally to improve performance.

C#
public bool EnableCaching { get; set; }

Implements: IMapTileProvider.EnableCaching

Gets the unique identifier for this Azure Maps provider instance.

C#
public string Id { get; }

Implements: IMapProvider.Id

Gets or sets a value indicating whether this AzureMapProvider has completed initialization and is ready for use.

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

true if initialized; otherwise, false.

Gets or sets a value indicating whether this AzureMapProvider is currently performing initialization operations.

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

true if initializing; otherwise, false.

Gets or sets the culture information used for localizing Azure Maps tiles, search results, and service responses.

C#
public CultureInfo LanguageCulture { get; set; }
Property Value:

The language culture for map tiles and search results.

Gets or sets the maximum zoom level supported by this Azure Maps provider for tile requests and map display.

C#
public int MaxZoomLevel { get; set; }

Implements: IMapProvider.MaxZoomLevel

Gets or sets the minimum zoom level supported by this Azure Maps provider for tile requests and map display.

C#
public int MinZoomLevel { get; set; }

Implements: IMapProvider.MinZoomLevel

Gets the settings that control tile rendering behavior.

C#
public MapTileProviderSettings Settings { get; }

Implements: IMapTileProvider.Settings

Gets or sets the tile downloader instance responsible for asynchronously downloading map tiles from Azure Maps service.

C#
public IMapTileDownloader TileDownloader { get; set; }

Implements: IMapTileProvider.TileDownloader

Gets or sets the Azure Maps tile set type that determines the visual style and content of map tiles.

C#
public AzureTileSet TileSetID { get; set; }

Gets the standard tile size in pixels used by this Azure Maps provider for all tile requests and rendering operations.

C#
public Size TileSize { get; }

Implements: IMapTileProvider.TileSize

Methods

Constructs the Azure Maps search request URI based on the search request parameters and selected search mode.

C#
protected virtual Uri BuildAzureSearchRequestUri(AzureSearchRequest request)
Parameters:requestAzureSearchRequest

The Azure search request containing query parameters and search options.

Returns:

Uri

The complete URI for the Azure Maps search API request.

Creates a deep copy of this AzureMapProvider instance with all configuration settings and state information.

C#
public object Clone()
Returns:

object

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

Implements: ICloneable.Clone()

Generates a unique cache key string for storing and retrieving tile images based on coordinates, zoom level, and tile set identifier.

C#
protected virtual string GetCacheKey(int tileX, int tileY, int zoomLevel)
Parameters:tileXint

The tile x.

tileYint

The tile y.

zoomLevelint

The zoom level.

Returns:

string

System.String.

Generates map visual elements for the specified viewport by converting cached tile images into renderable map tile elements.

C#
public 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 map tiles.

Implements: IMapProvider.GetContent(IMapViewport)

Retrieves a list of supported map views based on available Azure tile sets with selection state information.

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

List<MapViewInfo>

A list of MapViewInfo objects representing available Azure Maps tile sets.

Implements: IMapProvider.GetSupportedViews()

Constructs the URI for retrieving a specific map tile from Azure Maps service using tile matrix coordinates and zoom level.

C#
public Uri GetTile(int tileMatrixX, int tileMatrixY, int zoomLevel)
Parameters:tileMatrixXint

The tile matrix x.

tileMatrixYint

The tile matrix y.

zoomLevelint

The zoom level.

Returns:

Uri

Uri.

Synchronously retrieves a tile image from Azure Maps service or cache using the specified tile matrix coordinates and zoom level.

C#
public Image GetTileImage(int tileMatrixX, int tileMatrixY, int zoomLevel)
Parameters:tileMatrixXint

The tile matrix X coordinate.

tileMatrixYint

The tile matrix Y coordinate.

zoomLevelint

The zoom level for the tile.

Returns:

Image

The tile image, or null if the tile cannot be retrieved.

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

Retrieves the tile image for the specified TileInfo either from cache or by downloading from Azure Maps service.

C#
protected virtual void GetTileInfoImage(TileInfo tileInfo)
Parameters:tileInfoTileInfo

The tile information.

Initializes the Azure Maps provider by verifying service connectivity and preparing the tile matrix for use.

C#
public void Initialize()

Implements: IMapProvider.Initialize()

Handles the completion of asynchronous file loading from cache and initiates tile download if cache content is unavailable.

C#
protected virtual void OnFileLoadAsyncComplete(string fileName, byte[] content)
Parameters:fileNamestring

Name of the file.

contentbyte[]

The content.

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.

Raises the SearchCompleted event to notify subscribers that a search operation has finished successfully.

C#
protected virtual void OnSearchCompleted(AzureSearchCompletedEventArgs e)
Parameters:eAzureSearchCompletedEventArgs

The event arguments containing the search results.

Raises the SearchError event to notify subscribers that a search operation has encountered an error.

C#
protected virtual void OnSearchError(SearchErrorEventArgs e)
Parameters:eSearchErrorEventArgs

The event arguments containing the search error details.

Handles tile download completion events, manages cache storage, and updates wraparound tiles with downloaded content.

C#
protected virtual void OnTileDownloadComplete(object sender, TileInfoEventArgs e)
Parameters:senderobject

The sender.

eTileInfoEventArgs

The TileInfoEventArgs instance containing the event data.

Performs an asynchronous search operation using Azure Maps search services with the specified search request parameters.

C#
public void SearchAsync(AzureSearchRequest request)
Parameters:requestAzureSearchRequest

The Azure search request containing query text and search options.

Implements: IAzureMapSearchProvider.SearchAsync(AzureSearchRequest)

Processes the JSON search result response from Azure Maps service and deserializes it using multiple encoding strategies.

C#
protected virtual void SearchRequest(string searchResult)
Parameters:searchResultstring

The JSON search result string returned from Azure Maps search service.

Sets the active map view by configuring the tile set identifier based on the specified view information.

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

The map view information containing the desired tile set name.

Implements: IMapProvider.SetView(MapViewInfo)

Responds to viewport changes by calculating visible tiles, managing tile downloads, and updating the tile matrix for rendering.

C#
public 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 Azure Maps 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

Occurs when an Azure Maps search operation has completed successfully with search results.

C#
public event EventHandler<AzureSearchCompletedEventArgs> SearchCompleted

Implements: IAzureMapSearchProvider.SearchCompleted

Occurs when a search operation encounters an error during execution.

C#
public event EventHandler<SearchErrorEventArgs> SearchError

Implements: IAzureMapSearchProvider.SearchError