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

TdxMapControlAzureMapGeocodeProvider.CreateQueryParams Method

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

#Declaration

Delphi
function CreateQueryParams: IdxAzureMapGeocodeQueryParams;

#Returns

Type Description
IdxAzureMapGeocodeQueryParams

Stores Azure Maps Geocode query parameters.

#Remarks

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

#Asynchronous Queries and Server Responses

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

#Code Example: Obtain Point Coordinates by Address

The following code example implements a function that uses a configured information provider component to return the point on a map that corresponds to the specified address:

uses
  dxAzureMapInformationProviders;  // Declares TdxMapControlAzureMapGeocodeProvider
// ...

function TMyForm.GetAddressCoordinates(const AAddress: string): TdxMapControlGeoPoint;
var
  AParams: IdxAzureMapGeocodeQueryParams;
  AResponse: TdxAzureMapGeocodeRequestResponse;
  AGeometry: TGeoJSONGeometry;
begin
  AResult := nil;
  AParams := dxMapControl1AzureMapGeocodeProvider1.CreateQueryParams;
  AParams.Query := AAddress;
  dxMapControl1AzureMapGeocodeProvider1.Execute(AParams, AResponse);
  if AResponse <> nil then
  begin
    if AResponse.IsSuccess then
    begin
      AGeometry := AResponse.Features.First.Geometry;
      AResult := TdxMapControlGeoPoint.Create(AGeometry.Coordinates[1], AGeometry.Coordinates[0]);
    end;
  end;
end;
See Also