Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxMapControlAzureMapReverseGeocodeProvider.CreateQueryParams Method

Creates an information container required to send a query to an Azure Maps server.

#Declaration

Delphi
function CreateQueryParams: IdxAzureMapReverseGeocodeQueryParams;

#Returns

Type Description
IdxAzureMapReverseGeocodeQueryParams

Stores Azure Maps Reverse Geocode query parameters.

#Remarks

Call the CreateQueryParams function to create and configure server query parameters before an Execute or ExecuteAsync procedure call.

#Asynchronous Queries and Server Responses

To receive and process a response from an Azure Maps server after an ExecuteAsync procedure call, handle the OnResponse event.

#Code Example: Obtain Map Point Address

The following code example implements a procedure that uses a configured information provider component to create a pushpin at the specified point on the map and assign the point’s address to the pushpin hint:

uses
  dxAzureMapInformationProviders;  // Declares TdxMapControlAzureMapReverseGeocodeProvider
// ...

procedure TMyForm.AddPushpin(AGeoPoint: TdxMapControlGeoPoint);
var
  APushpin: TdxMapPushpin;
  AParams: IdxAzureMapReverseGeocodeQueryParams;
  AResponse: TdxAzureMapReverseGeocodeRequestResponse;
begin
  // Creates a new pushpin on an existing map item layer
  APushpin := dxMapControl1ItemLayer1.MapItems.Add(TdxMapPushpin) as TdxMapPushpin;
  APushpin.Location.GeoPoint := AGeoPoint;
  AParams := dxMapControl1AzureMapReverseGeocodeProvider1.CreateQueryParams;
  AParams.Coordinates := APushpin.Location.GeoPoint;
  // Uses a configured reverse geocode provider to send a query to an Azure Maps server
  dxMapControl1AzureMapReverseGeocodeProvider1.Execute(AParams, AResponse);
  try
    if AResponse <> nil then  // Checks if a server response is received
    begin
      if AResponse.IsSuccess and (AResponse.Features.Count > 0) then  // Checks if the query is successful
        APushpin.Hint := AResponse.Features.First.Properties.Address.FormattedAddress;
    end;
  finally
    AResponse.Free;  // Deletes the query result regardless of the operation's success 
  end;
end;
See Also