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
- Drop
TTMSFNCElevation from the TMS FNC Maps palette page onto a form.
- Set the
APIKey property.
- Set the
Service property to choose the elevation backend.
Query elevation at a coordinate
{ Inside a button click handler: }
var
Req: TTMSFNCElevationRequest;
begin
Req := TMSFNCElevation1.Requests.Add;
Req.RequestData.Add.Coordinate.Latitude := 45.4215;
Req.RequestData.Add.Coordinate.Longitude := -75.6972;
TMSFNCElevation1.GetElevation;
end;
Handle the result
procedure TForm1.TMSFNCElevation1GetElevation(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCElevationRequest;
AElevation: TTMSFNCElevationItems);
begin
{ AElevation[0].ElevationData contains the altitude in metres }
end;
Next steps