TdxMapImageTileLayer.ProviderClass Property
Specifies the active map tile provider type.
Declaration
property ProviderClass: TdxMapControlImageTileProviderClass read; write;
Property Value
Type | Description |
---|---|
TdxMapControlImageTileProviderClass | The reference to the active map tile provider class. Refer to the Remarks section for the full list of supported tile provider types. |
Remarks
Use the ProviderClass
property to switch between available data providers for the map tile layer. To configure data provider settings, use the Provider property.
Available Map Tile Providers
You can assign references to the following classes to the ProviderClass
property to select the corresponding tile provider:
- TdxMapControlAzureMapImageryDataProvider
- Loads map tiles from Azure Maps servers.
- TdxMapControlOpenStreetMapImageryDataProvider
- Loads map tiles from the OpenStreetMap service.
Tile Provider Selection at Design Time
You can use the Object Inspector to select any available tile data provider at design time. Select an image tile layer, click the Provider node’s drop-down button and select the required data provider in the menu.
Property Setter Behavior
The ProviderClass
property setter updates Provider and ProviderClassName property values according to the selected tile data provider type.
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;
Related Compiled Demo
To see map tile layers with all supported information providers in action, run the Mapping demo in the VCL Demo Center installed with compiled DevExpress demos. Click the Data Providers item in the side bar to the left and switch between available data providers in the Ribbon UI.
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