vcl-dxazuremapimagerydataprovider-dot-tdxmapcontrolazuremapimagerydataprovider-35cf7a10.md
Applies all pending changes and sends the corresponding request to Azure Maps servers to update tile data.
procedure EndUpdate;
Every time you change a tile provider’s settings (for example, change the active tileset), the provider sends a request to Azure servers to download corresponding data. Enclose multiple provider setting changes between BeginUpdate and EndUpdate procedure calls to avoid excessive data requests and improve performance.
Note
Ensure that every BeginUpdate procedure call is followed by an EndUpdate call, even if an exception occurs. Otherwise, the current tile layer remains unable to update tile 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; // 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;
#include "dxAzureMapImageryDataProvider.hpp" // Declares TdxMapControlAzureMapImageryDataProvider
// ...
void __fastcall TMyForm::AddAzureMapLayer(const UnicodeString &AAzureKey)
{
TdxMapLayer *ALayer;
TdxMapImageTileLayer *ATileLayer;
TdxMapControlAzureMapImageryDataProvider *AProvider;
ALayer = dxMapControl1->Layers->Add(__classid(TdxMapImageTileLayer));
ATileLayer = dynamic_cast<TdxMapImageTileLayer*>(ALayer);
ATileLayer->ProviderClass = __classid(TdxMapControlAzureMapImageryDataProvider);
AProvider = dynamic_cast<TdxMapControlAzureMapImageryDataProvider*>(ATileLayer->Provider);
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
}
}
See Also
TdxMapControlAzureMapImageryDataProvider Class