Table of Contents

Getting started with TMS FNC Google Routes

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.
  • A Google Cloud API key with the Routes API enabled.

Add the component

  1. Drop TTMSFNCGoogleRoutes from the TMS FNC Maps palette page onto a form.
  2. Set the APIKey property to your Google API key.

Request routes

{ Inside a button click handler: }
var
  Req: TTMSFNCGoogleRoutesRequest;
begin
  Req := TMSFNCGoogleRoutes1.Requests.Add;
  Req.Origin.Latitude := 37.7749;
  Req.Origin.Longitude := -122.4194;
  Req.Destination.Latitude := 34.0522;
  Req.Destination.Longitude := -118.2437;
  TMSFNCGoogleRoutes1.GetDirections;
end;

Next steps

  • Guides — traffic advisory, speed data, and request options.
  • API reference — full class reference.