Skip to main content
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

Request routesPascalC++
{ Inside a button click handler: }
var
  Origin, Destination: TTMSFNCMapsCoordinateRec;
begin
  Origin.Latitude := 37.7749;
  Origin.Longitude := -122.4194;
  Destination.Latitude := 34.0522;
  Destination.Longitude := -118.2437;
  TMSFNCGoogleRoutes1.GetDirections(Origin, Destination);
end;
// Inside a button click handler:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TTMSFNCMapsCoordinateRec Origin, Destination;
  Origin.Latitude = 37.7749;
  Origin.Longitude = -122.4194;
  Destination.Latitude = 34.0522;
  Destination.Longitude = -118.2437;
  TMSFNCGoogleRoutes1->GetDirections(Origin, Destination);
}

Next steps

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