FNC Maps Openrouteservice Travelmode TRUCK - Truck properties

I have built the consideration of the weight of the truck into TTMSFNCDirectionsOpenRouteServiceDirections.GetPostData. In this direction, the properties could possibly be queried and included. I have currently hard coded 18 tonnes. Perhaps you could take this as an approach and include the truck properties in GetPostData :smile:

function TTMSFNCDirectionsOpenRouteServiceDirections.GetPostData(AOriginLatitude, AOriginLongitude,
ADestinationLatitude, ADestinationLongitude: Double; AAlternatives: Boolean = False;
ATravelMode: TTMSFNCDirectionsTravelMode = tmDriving;
AWayPoints: TTMSFNCMapsCoordinateRecArray = nil; ALocale: string = ''; AAvoidTolls: Boolean = False): string;
var
coords, tolls, alts, lang, options: string;
I, wpcount: Integer;

function CoordToStr(Latitude, Longitude: Double): string;
begin
Result := '[' + FloatToStrDot(Longitude) + ',' + FloatToStrDot(Latitude) + ']';
end;

begin
wpcount := 0;
coords := CoordToStr(AOriginLatitude, AOriginLongitude);
if Assigned(AWayPoints) then
begin
wpcount := Length(AWayPoints);
for I := 0 to wpcount - 1 do
begin
coords := coords + ', ' + CoordToStr(AWayPoints[I].Latitude, AWayPoints[I].Longitude);
end;
end;
coords := coords + ', ' + CoordToStr(ADestinationLatitude, ADestinationLongitude);

if ATravelMode in [tmDriving, tmTruck] then
begin
options := ',"options":{';
if AAvoidTolls then
options := '"avoid_features":["tollways"]';

//My changes
if ATravelMode = tmTruck then begin
if AAvoidTolls then
options := options + ',';

options := options + '"vehicle_type": "hgv", "profile_params": {"restrictions": {"weight": 18}}}';

end;
options := options + '}';
end;

if wpcount <= 0 then
begin
if AAlternatives then
alts := ',"alternative_routes":{"target_count":2}';
end;

if ALocale <> '' then
lang := ', "language": "' + ALocale + '"';

Result := '{"coordinates":[' + coords + ']' + lang + alts + options + '}';