Table of Contents

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

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

Forward geocode an address

{ Inside a button click handler: }
var
  Req: TTMSFNCGeocodingRequest;
begin
  Req := TMSFNCGeocoding1.Requests.Add;
  Req.Address := 'Buckingham Palace, London';
  TMSFNCGeocoding1.GetGeocoding;
end;

Handle the result

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;

Next steps

  • Guides — forward geocoding, reverse geocoding, and result handling.
  • API reference — full class reference.