Table of Contents

Getting started with TMS FNC Places

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 places service backend you intend to use.

Add the component

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

Search for places

{ Inside a button click handler: }
var
  Req: TTMSFNCPlacesRequest;
begin
  Req := TMSFNCPlaces1.Requests.Add;
  Req.Query := 'coffee shop';
  Req.Coordinate.Latitude := 51.5074;
  Req.Coordinate.Longitude := -0.1278;
  TMSFNCPlaces1.GetPlaces;
end;

Handle the result

procedure TForm1.TMSFNCPlaces1GetPlaces(
  Sender: TObject; ARequestIndex: Integer;
  ARequest: TTMSFNCPlacesRequest;
  APlaces: TTMSFNCPlacesItems);
begin
  { Iterate APlaces for name, coordinate, and address }
end;

Next steps

  • Guides — keyword search, nearby search, and place details.
  • API reference — full class reference.