TdxMapControlInformationProviders.Items Property
In This Article
Provides indexed access to stored map information provider components.
#Declaration
Delphi
property Items[Index: Integer]: TdxMapControlInformationProvider read; write; default;
#Property Value
Type | Description |
---|---|
Tdx |
An auxiliary map information provider. To access all public API members of an information provider, you need to cast the returned object to the corresponding terminal Tdx Tip You can call the Class |
#Remarks
Use the Count property to identify the number of information providers accessible through the Items
property.
#Code Example: Create and Configure Azure Maps Information Providers
The following code example implements a procedure that accepts an Azure Maps account key, and creates and configures all Azure Maps information provider components:
uses
dxAzureMapInformationProviders; // Declares all Azure Maps information provider classes
// ...
procedure TMyForm.CreateAzureMapsInformationProviders(const AAzureKey: string);
var
AProviders: TdxMapControlInformationProviders;
AProvider: TdxMapControlAzureMapInformationProvider;
I: Integer;
begin
AProviders := dxMapControl1.InformationProviders;
AProviders.BeginUpdate; // Initiates the following batch change
try
// Create all Azure Maps information providers
AProviders.Add(TdxMapControlAzureMapGeocodeProvider);
AProviders.Add(TdxMapControlAzureMapGeolocationProvider);
AProviders.Add(TdxMapControlAzureMapReverseGeocodeProvider);
AProviders.Add(TdxMapControlAzureMapRouteProvider);
for I := 0 to AProviders.Count - 1 do // Iterates through all created information providers
begin
AProvider := AProviders.Items[I] as TdxMapControlAzureMapInformationProvider;
AProvider.AzureKey := AAzureKey; // Assigns the same Azure Maps account key to all providers
end;
finally
AProviders.EndUpdate; // Calls EndUpdate regardless of the batch operation's success
end;
end;
See Also