TdxAzureMapResponse Class
The base class for data transfer objects designed to store responses from Azure Maps servers.
#Declaration
TdxAzureMapResponse = class(
TdxRestServiceResponse
)
#Remarks
TdxAzureMapResponse
is the base class for all DTOs (data transfer objects) that return information in response to queries sent by auxiliary Azure Maps information providers.
#Main API Members
The list below outlines key members of the TdxAzureMapResponse
class. These members allow you to obtain general server response information.
- ErrorInfo
Provides access to detailed error information if the current server query is not successful.
This property is initialized only if a server returns error information.
- IsSuccess
Identifies if the current server query is successful.
If the IsSuccess property returns
False
, you can use ErrorInfo and StatusCode properties to obtain detailed information on the error.- QueryParams
- Provides access to information returned in response to the current query.
- StatusCode
- Returns the server response status code.
#Code Example: Validate Server Response
The code example in this topic section demonstrates a function that checks if an Azure Maps server response is valid. The function returns False
and displays a message box with the corresponding error message if a server query fails.
uses
dxMessageDialog; // This unit declares the dxMessageDlg global function
// ...
function TMyForm.ValidateServerResponse(AResponse: TdxAzureMapResponse): Boolean;
begin
if AResponse <> nil then
begin
Result := AResponse.IsSuccess;
if not Result and Assigned(AResponse.ErrorInfo) then
dxMessageDlg(AResponse.ErrorInfo.Message, TMsgDlgType.mtError, [mbOK], 0);
end
else
Result := False;
end;
#Terminal TdxAzureMapResponse Class Descendants
Do not use the TdxAzureMapResponse
class directly. Use the following descendants instead:
- TdxAzureMapGeocodeRequestResponse
- TdxAzureMapGeolocationRequestResponse
- TdxAzureMapReverseGeocodeRequestResponse
- TdxAzureMapRouteRequestResponse