Class
AzureMapProvider

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:

cs-api-definition
public class AzureMapProvider : IMapTileProvider, IMapProvider, ICloneable, IAzureMapSearchProvider, IMapBaseSearchProvider

Inheritance: objectAzureMapProvider

Implements: IAzureMapSearchProviderICloneableIMapBaseSearchProviderIMapProviderIMapTileProvider

Constructors

AzureMapProvider()

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

Declaration

cs-api-definition
public AzureMapProvider()

Fields

cacheLoadReference

Declaration

cs-api-definition
protected Dictionary<string, List<TileInfo>> cacheLoadReference

Field Value

Dictionary<string, List<TileInfo>>

lockObj

Declaration

cs-api-definition
protected object lockObj

Field Value

object

tileMatrix

Declaration

cs-api-definition
protected Dictionary<string, TileInfo> tileMatrix

Field Value

Dictionary<string, TileInfo>

Properties

AzureAPIKey

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

Declaration

cs-api-definition
public string AzureAPIKey { get; set; }

Property Value

string

The azure map key.

AzureAPIVersion

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

Declaration

cs-api-definition
public string AzureAPIVersion { get; set; }

Property Value

string

The azure map API version.

CacheProvider

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

Declaration

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

Property Value

IMapCacheProvider

Implements IMapTileProvider.CacheProvider

EnableCaching

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

Declaration

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

Property Value

bool

Implements IMapTileProvider.EnableCaching

Id

Gets the unique identifier for this Azure Maps provider instance.

Declaration

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

Property Value

string

Implements IMapProvider.Id

Initialized

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

Declaration

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

Property Value

bool

true if initialized; otherwise, false.

Initializing

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

Declaration

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

Property Value

bool

true if initializing; otherwise, false.

LanguageCulture

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

Declaration

cs-api-definition
public CultureInfo LanguageCulture { get; set; }

Property Value

CultureInfo

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.

Declaration

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

Property Value

int

Implements IMapProvider.MaxZoomLevel

MinZoomLevel

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

Declaration

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

Property Value

int

Implements IMapProvider.MinZoomLevel

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 responsible for asynchronously downloading map tiles from Azure Maps service.

Declaration

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

Property Value

IMapTileDownloader

Implements IMapTileProvider.TileDownloader

TileSetID

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

Declaration

cs-api-definition
public AzureTileSet TileSetID { get; set; }

Property Value

AzureTileSet

TileSize

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

Declaration

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

Property Value

Size

Implements IMapTileProvider.TileSize

Methods

BuildAzureSearchRequestUri(AzureSearchRequest)

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

Declaration

cs-api-definition
protected virtual Uri BuildAzureSearchRequestUri(AzureSearchRequest request)

Parameters

request

AzureSearchRequest

The Azure search request containing query parameters and search options.

Returns

Uri

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

cs-api-definition
public object Clone()

Returns

object

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

Implements ICloneable.Clone()

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.

Declaration

cs-api-definition
protected virtual string GetCacheKey(int tileX, int tileY, int zoomLevel)

Parameters

tileX

int

The tile x.

tileY

int

The tile y.

zoomLevel

int

The zoom level.

Returns

string

System.String.

GetContent(IMapViewport)

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

Declaration

cs-api-definition
public 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 map tiles.

Implements IMapProvider.GetContent(IMapViewport)

GetSupportedViews()

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

Declaration

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

Returns

List<MapViewInfo>

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

Implements IMapProvider.GetSupportedViews()

GetTile(int, int, int)

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

Declaration

cs-api-definition
public Uri GetTile(int tileMatrixX, int tileMatrixY, int zoomLevel)

Parameters

tileMatrixX

int

The tile matrix x.

tileMatrixY

int

The tile matrix y.

zoomLevel

int

The zoom level.

Returns

Uri

Uri.

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

cs-api-definition
public Image GetTileImage(int tileMatrixX, int tileMatrixY, int zoomLevel)

Parameters

tileMatrixX

int

The tile matrix X coordinate.

tileMatrixY

int

The tile matrix Y coordinate.

zoomLevel

int

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)

GetTileInfoImage(TileInfo)

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

Declaration

cs-api-definition
protected virtual void GetTileInfoImage(TileInfo tileInfo)

Parameters

tileInfo

TileInfo

The tile information.

Initialize()

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

Declaration

cs-api-definition
public void Initialize()

Implements IMapProvider.Initialize()

OnFileLoadAsyncComplete(string, byte[])

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

Declaration

cs-api-definition
protected virtual void OnFileLoadAsyncComplete(string fileName, byte[] content)

Parameters

fileName

string

Name of the file.

content

byte[]

The content.

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.

OnSearchCompleted(AzureSearchCompletedEventArgs)

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

Declaration

cs-api-definition
protected virtual void OnSearchCompleted(AzureSearchCompletedEventArgs e)

Parameters

e

AzureSearchCompletedEventArgs

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

cs-api-definition
protected virtual void OnSearchError(SearchErrorEventArgs e)

Parameters

e

SearchErrorEventArgs

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

cs-api-definition
protected virtual void OnTileDownloadComplete(object sender, TileInfoEventArgs e)

Parameters

sender

object

The sender.

e

TileInfoEventArgs

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

cs-api-definition
public void SearchAsync(AzureSearchRequest request)

Parameters

request

AzureSearchRequest

The Azure search request containing query text and search options.

Implements IAzureMapSearchProvider.SearchAsync(AzureSearchRequest)

SearchRequest(string)

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

Declaration

cs-api-definition
protected virtual void SearchRequest(string searchResult)

Parameters

searchResult

string

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

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

Parameters

view

MapViewInfo

The map view information containing the desired tile set name.

Implements IMapProvider.SetView(MapViewInfo)

ViewportChanged(IMapViewport, ViewportChangeAction)

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

Declaration

cs-api-definition
public 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 Azure Maps 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

SearchCompleted

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

Declaration

cs-api-definition
public event EventHandler<AzureSearchCompletedEventArgs> SearchCompleted

Event Value

EventHandler<AzureSearchCompletedEventArgs>

Implements IAzureMapSearchProvider.SearchCompleted

SearchError

Occurs when a search operation encounters an error during execution.

Declaration

cs-api-definition
public event EventHandler<SearchErrorEventArgs> SearchError

Event Value

EventHandler<SearchErrorEventArgs>

Implements IAzureMapSearchProvider.SearchError