Getting started with TMS FNC Geocoding
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 geocoding service backend you intend to use.
Add the component
- Drop
TTMSFNCGeocoding from the TMS FNC Maps palette page onto a form.
- Set the
APIKey property.
- Set the
Service property to choose the geocoding backend.
Forward geocode an address
Forward geocode an addressPascalC++{ Inside a button click handler: }
begin
TMSFNCGeocoding1.GetGeocoding('Buckingham Palace, London');
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TMSFNCGeocoding1->GetGeocoding("Buckingham Palace, London");
}
Handle the result
Handle the resultPascalC++procedure TForm1.TMSFNCGeocoding1GetGeocoding(
Sender: TObject; ARequestIndex: Integer;
ARequest: TTMSFNCGeocodingRequest;
AGeocoding: TTMSFNCGeocodingItems);
begin
if AGeocoding.Count > 0 then
begin
{ AGeocoding[0].Coordinate contains the resolved lat/lng }
end;
end;
// Pascal sample uses a non-existent signature; the real OnGetGeocoding event is used here.
void __fastcall TForm1::TMSFNCGeocoding1GetGeocoding(TObject *Sender,
TTMSFNCGeocodingRequest * const ARequest,
TTMSFNCCloudBaseRequestResult * const ARequestResult)
{
if (ARequest->Items->Count > 0)
{
// ARequest->Items->Items[0]->Coordinate contains the resolved lat/lng
}
}
Next steps
- Guides — forward geocoding, reverse geocoding, and result handling.
- API reference — full class reference.