Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxMapControlAzureMapImageryDataProvider Class

An Azure Maps tile data provider.

#Declaration

Delphi
TdxMapControlAzureMapImageryDataProvider = class(
    TdxMapControlImageTileProvider
)

#Remarks

An Azure Maps tile data provider is the main component required to display Microsoft Azure Maps® in the Map Control. You need to configure the data provider for each tile map layer in your application.

VCL Map Control: An Azure Maps Usage Example

#Azure Maps Account

To use Microsoft Azure Maps® services, you need to create an Azure Maps account and obtain a key. Assign the account key to the AzureKey property to configure the data provider.

#Main API Members

The list below outlines key members of the TdxMapControlAzureMapImageryDataProvider class. These members allow you to configure the Azure Maps tile provider.

AzureKey
Required. Specifies the account key required to use the Azure Maps tile provider.
CacheOptions
Provides access to tile data cache settings.
Language
Optional. Specifies the required language.
LocalizedMapView
Optional. Specifies the target region. This property allows you to download region-specific map tile information.
MaxParallelConnectionCount
Limits the number of parallel connections to Azure Maps servers.
Tileset
Specifies the required tileset.
UTCTimeStamp
Allows you to display time-specific map information if a weather data tileset is active.

#General-Purpose API Members

Assign
Copies settings between Azure Maps tile providers.
BeginUpdate | EndUpdate
Allow you to avoid excessive server requests and notifications during batch setting changes in the map tile provider.

#Code Example: Add a Tile Map Layer and Load Azure Maps Data

The following code example implements a procedure that accepts an Azure Maps account key, creates and configures a map tile layer, and loads data:

uses
  dxAzureMapImageryDataProvider;  // This unit declares TdxMapControlAzureMapImageryDataProvider
// ...

procedure TMyForm.AddAzureMapLayer(const AAzureKey: string);
var
  ATileLayer: TdxMapImageTileLayer;
  AProvider: TdxMapControlAzureMapImageryDataProvider;
begin
  ATileLayer := dxMapControl1.Layers.Add(TdxMapImageTileLayer) as TdxMapImageTileLayer;
  ATileLayer.ProviderClass := TdxMapControlAzureMapImageryDataProvider;
  AProvider := ATileLayer.Provider as TdxMapControlAzureMapImageryDataProvider;
  AProvider.BeginUpdate;  // Initiates the following batch change
  try
    AProvider.AzureKey := AAzureKey;  // Assigns the Azure account key
    AProvider.Tileset := TdxAzureMapTileset.Satellite;  // Changes the default tileset
    AProvider.MaxParallelConnectionCount := 8;  // Explicitly defines the number of parallel connections
  finally
    AProvider.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;

#Microsoft Azure Map Information Providers

Map information providers complement the tile data provider and allow you to display additional map-related information, such as routes. The Map Control ships with the following Azure Maps information providers:

TdxMapControlAzureMapGeocodeProvider
An Azure Maps Geocode information provider.
TdxMapControlAzureMapGeolocationProvider
An Azure Maps Geolocation information provider.
TdxMapControlAzureMapReverseGeocodeProvider
An Azure Maps Reverse Geocode information provider.
TdxMapControlAzureMapRouteProvider
An Azure Maps Route information provider.

Important

You need to assign the same Azure Maps account to the AzureKey property of each map information provider in the application.

#Indirect TdxMapControlAzureMapImageryDataProvider Class Reference

The TdxMapImageTileLayer.Provider property references the TdxMapControlAzureMapImageryDataProvider class as a TdxMapControlImageTileProvider object if the ProviderClass property is set to TdxMapControlAzureMapImageryDataProvider.

You need to cast the returned object to the TdxMapControlAzureMapImageryDataProvider class to access all public API members.

#Direct TdxMapControlAzureMapImageryDataProvider Class Reference

The TdxMapControlImageTileProviderClass type references the TdxMapControlAzureMapImageryDataProvider class.

To see Microsoft Azure Map tile and information providers in action, run the Mapping demo in the VCL Demo Center installed with compiled DevExpress demos. When the demo is opened, it downloads tile data and additional information from Azure Map servers to display a map and build routes between specified points.

Download: Compiled VCL Demos

Tip

Compiled DevExpress demos ship with source code installed in the Public Documents folder (%Public%) for all users (default). You can find all project and source code files for the Map Control demo in the following folder:

%Public%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressMapControl

#Inheritance

See Also