Getting started with TMS FNC Location
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 location service backend (some services allow limited use without a key).
Add the component
- Drop
TTMSFNCLocationfrom the TMS FNC Maps palette page onto a form. - Set the
APIKeyproperty if required by your chosen service. - Set the
Serviceproperty to choose the location backend.
Look up an IP address
{ Inside a button click handler: }
begin
TMSFNCLocation1.GetLocation;
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TMSFNCLocation1->GetLocation();
}
Handle the result
procedure TForm1.TMSFNCLocation1GetLocation(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCLocationRequest;
ALocation: TTMSFNCLocationRequests);
begin
{ ALocation[0] contains Latitude, Longitude, City, Country }
end;
// Pascal sample uses a non-existent signature; the real OnGetLocation event is used here.
void __fastcall TForm1::TMSFNCLocation1GetLocation(TObject *Sender,
TTMSFNCLocationRequest * const ARequest,
TTMSFNCCloudBaseRequestResult * const ARequestResult)
{
// ARequest contains Latitude, Longitude, City, Country
}
Next steps
- Guides — requests and result handling.
- API reference — full class reference.