Back to Devexpress

TdxMapControlAzureMapImageryDataProvider.Language Property

vcl-dxazuremapimagerydataprovider-dot-tdxmapcontrolazuremapimagerydataprovider-1539d923.md

latest3.7 KB
Original Source

TdxMapControlAzureMapImageryDataProvider.Language Property

Specifies the locale (culture) name used to download data from Azure GIS services.

Declaration

delphi
property Language: string read; write;

Property Value

TypeDescription
string

The culture name that corresponds to the target written language and locale.

|

Remarks

Use the Language property to display a localized map version.

Refer to the following topic for the full list of languages supported in Azure Maps services: Localization Support in Azure Maps.

Code Example: Display a Localized Map Version

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

delphi
uses
  dxAzureMapImageryDataProvider; // Declares TdxMapControlAzureMapImageryDataProvider
// ...

procedure TMyForm.AddLocalizedAzureMapLayer(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.Language := 'el-GR'; // Changes the map language to Greek
  finally
    AProvider.EndUpdate; // Calls EndUpdate regardless of the batch operation's success
  end;
end;
cpp
#include "dxAzureMapImageryDataProvider.hpp" // Declares TdxMapControlAzureMapImageryDataProvider
// ...

void __fastcall TMyForm::AddLocalizedAzureMapLayer(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->Language = "el-GR"; // Changes the map language to Greek
  }
  __finally
  {
    AProvider->EndUpdate(); // Calls EndUpdate regardless of the batch operation's success
  }
}

See Also

TdxMapControlAzureMapImageryDataProvider.LocalizedMapView Property

TdxMapControlAzureMapImageryDataProvider Class

TdxMapControlAzureMapImageryDataProvider Members

dxAzureMapImageryDataProvider Unit