Skip to main content
Table of Contents

Getting started with TMS FNC Elevation

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Maps installed and the runtime package added to the project.
  • An API key for the elevation service backend you intend to use.

Add the component

  1. Drop TTMSFNCElevation from the TMS FNC Maps palette page onto a form.
  2. Set the APIKey property.
  3. Set the Service property to choose the elevation backend.

Query elevation at a coordinate

Query elevation at a coordinatePascalC++
{ Inside a button click handler: }
var
  Coordinate: TTMSFNCMapsCoordinateRec;
begin
  Coordinate.Latitude := 45.4215;
  Coordinate.Longitude := -75.6972;
  TMSFNCElevation1.GetElevation(Coordinate);
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TTMSFNCMapsCoordinateRec Coordinate;
  Coordinate.Latitude = 45.4215;
  Coordinate.Longitude = -75.6972;
  TMSFNCElevation1->GetElevation(Coordinate);
}

Handle the result

Handle the resultPascalC++
procedure TForm1.TMSFNCElevation1GetElevation(
  Sender: TObject; ARequestIndex: Integer;
  ARequest: TTMSFNCElevationRequest;
  AElevation: TTMSFNCElevationItems);
begin
  { AElevation[0].ElevationData contains the altitude in metres }
end;
// Pascal sample uses a non-existent signature; the real OnGetElevation event is used here.
void __fastcall TForm1::TMSFNCElevation1GetElevation(TObject *Sender,
  TTMSFNCElevationRequest * const ARequest,
  TTMSFNCCloudBaseRequestResult * const ARequestResult)
{
  // ARequest->Items[0]->ElevationData contains the altitude in metres
}

Next steps

  • Guides — single and batch requests, and result handling.
  • API reference — full class reference.