TdxMapControlAzureMapImageryDataProvider Class
An Azure Maps tile data provider.
Declaration
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.
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 map tile provider.
Server-Related Settings
- AzureKey
- Required. Specifies the account key required to use the Azure map 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 Map servers.
- Tileset
- Specifies the required tileset.
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 service provider.
- TdxMapControlAzureMapReverseGeocodeProvider
- A reverse geocode Azure Maps 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.
Related Compiled Demo
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.
Tip
You can find full source code for installed complied Map Control demos in the following folder:
%PUBLIC%\Public Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressMapControl