What’s new in TMS FNC Maps v2.0
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
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.
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.
The second click will set the first waypoint for your route
Then every subsequent click will add a new waypoint
Drag and drop an existing segment to insert a new waypoint
Drag and drop an existing waypoint to a new location
Waypoints and segments can also be selected and optionally removed from the route
OpenLayers polyline & polygon labels
It’s now possible to associate a label text with a polyline or polygon in TTMSFNCOpenLayers.
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
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;