Table of Contents

Getting started with TMS FNC Directions

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

Add the component

  1. Drop TTMSFNCDirections from the TMS FNC Maps palette page onto a form.
  2. Set the APIKey property.
  3. Set the Service property to the desired routing backend.

Request directions

{ Inside a button click handler: }
var
  Req: TTMSFNCDirectionsRequest;
begin
  Req := TMSFNCDirections1.Requests.Add;
  Req.Origin.Latitude := 51.5074;
  Req.Origin.Longitude := -0.1278;
  Req.Destination.Latitude := 48.8566;
  Req.Destination.Longitude := 2.3522;
  TMSFNCDirections1.GetDirections;
end;

Handle the result

procedure TForm1.TMSFNCDirections1GetDirections(
  Sender: TObject; ARequestIndex: Integer;
  ARequest: TTMSFNCDirectionsRequest;
  ADirections: TTMSFNCDirectionsItems);
begin
  { ADirections contains route items with legs and steps }
end;

Next steps

  • Guides — multi-stop routes, travel mode, and result handling.
  • API reference — full class reference.