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](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator.png)
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, Google, Here, MapBox
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.
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 Maps, Here, OpenLayers
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](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample1.png)
The second click will set the first waypoint for your route
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample2.png)
Then every subsequent click will add a new waypoint
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample3.png)
Drag and drop an existing segment to insert a new waypoint
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample4.png)
Drag and drop an existing waypoint to a new location
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample5.png)
Waypoints and segments can also be selected and optionally removed from the route
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample6.png)
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncroutecalculator_sample7.png)
OpenLayers polyline & polygon labels
It's now possible to associate a label text with a polyline or polygon in TTMSFNCOpenLayers.
![TMS Software Delphi Components](https://www.tmssoftware.com/site/img/screens/tmsfncopenlayers_polylinelabel.png)
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](https://www.tmssoftware.com/site/img/screens/tmsfncgooglemaps_geodesic.png)
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
![](img/handwrite_message_24.png)
This blog post has received 2 comments.
![](img/bullets/6.png)
![](img/handwrite_message_24.png)
Bruno Fierens
All Blog Posts | Next Post | Previous Post
Stephen