Blog

All Blog Posts  |  Next Post  |  Previous Post

What's new in TMS FNC Maps v2.0

Friday, July 30, 2021

Introducing the TTMSFNCRouteCalculator component, OpenLayers polyline labels and Google Maps geodesic polylines with the release of TMS FNC Maps v2.0.



Route calculator with map interaction


TMS Software Delphi  Components

The new TTMSFNCRouteCalculator component lets you create and edit routes based on existing directions and geocoding services. Routes can also be imported from GPX and exported to GPX. The TTMSFNCRouteCalculator allows you to create a new route, add, update and remove waypoints or segments. This standalone component can be used to manage routes programmatically, then save or export your routes for later use.

The following directions & geocoding services are supported: Azure, Bing, GoogleHereMapBox

In combination with TTMSFNCMaps routes can be created, edited and displayed by interacting with the map.
Simply assigning a TTMSFNCRouteCalculator to the TTMSFNCMaps component will enable the map interaction as well as extra methods and events.

  TMSFNCRouteCalculator1.Active := True;
  TMSFNCMaps1.RouteCalculator := TMSFNCRouteCalculator1;

The following mapping services are supported: Google MapsHereOpenLayers 
  

The steps below require no additional code at all, this is done by interacting with the map only.
Now the first step is to pick a start location with a single click on the map.

TMS Software Delphi  Components

The second click will set the first waypoint for your route

TMS Software Delphi  Components

Then every subsequent click will add a new waypoint

TMS Software Delphi  Components

Drag and drop an existing segment to insert a new waypoint

TMS Software Delphi  Components

Drag and drop an existing waypoint to a new location
TMS Software Delphi  Components

Waypoints and segments can also be selected and optionally removed from the route

TMS Software Delphi  Components

TMS Software Delphi  Components



OpenLayers polyline & polygon labels


It's now possible to associate a label text with a polyline or polygon in TTMSFNCOpenLayers.

TMS Software Delphi  Components


This feature is currently only available for: OpenLayers

This sample demonstrates how to add a label text to an existing polyline, configure the label's appearance and position, then make sure the polyline is updated on the map.

  TMSFNCOpenLayers1.BeginUpdate;
  TMSFNCOpenLayers1.Polylines[0].&Label.Text := 'Route from New York to Washington';
  TMSFNCOpenLayers1.Polylines[0].&Label.FontColor := gcRed;
  TMSFNCOpenLayers1.Polylines[0].&Label.FontSize := 18;
  TMSFNCOpenLayers1.Polylines[0].&Label.OffsetX := 170;
  TMSFNCOpenLayers1.Polylines[0].Recreate := True;
  TMSFNCOpenLayers1.EndUpdate;


Google Maps geodesic polylines


TMS Software Delphi  Components

Another new features is the possibility to display geodesic polylines with Google Maps.

This feature is currently only available for : Google Maps

Just set the polyline's Geodesic property to True to make it display as a geodesic line.

  TMSFNCGoogleMaps1.Polylines[0].Geodesic := True;


That's it for this TMS FNC Maps v2.0 update. I hope you'll enjoy all these exciting new features!


Bart Holvoet




This blog post has received 2 comments.


1. Tuesday, December 12, 2023 at 3:05:47 PM

Is the source for this example available?




Stephen


2. Tuesday, December 12, 2023 at 5:46:17 PM

All samples we have can be found in the product distribution under subfolder \Demo

Bruno Fierens




Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post