TdxMapLayerClass Type
In This Article
A reference to a map layer class.
#Declaration
Delphi
TdxMapLayerClass = class of TdxMapLayer;
#Referenced Class
Type | Description |
---|---|
Tdx |
The base class for all map layer classes. |
#Remarks
You can use the TdxMapLayerClass
type to refer to the following [TdxMapLayer] class descendants:
- TdxMapImageTileLayer
- A map tile layer.
- TdxMapItemFileLayer
- An item file layer.
- TdxMapItemLayer
- An item layer.
#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;
#Direct TdxMapLayerClass Type Reference
The TdxMapLayers.Add function accepts a TdxMapLayerClass
value as the AItemClass
parameter.
See Also