Despite the "avoid" property of the route options being an array, as per the link below:
https://learn.microsoft.com/en-us/rest/api/maps/route/getroutedirections#avoid
When attempting to pass these through the RouteURL.calculateRouteDirections() as an array it causes a TypeError: r.toLowerCase is not a function in atlas-service.min.js
https://learn.microsoft.com/en-us/javascript/api/azure-maps-rest/atlas.service.routeurl?view=azure-maps-typescript-latest#calculateroutedirections-aborter--geojson-position----calculateroutedirectionsoptions-
Here is the object model we're passing:
// Route options to be passed through
var routeOptions = {
avoid: ['motorways', 'tollRoads'],
departAt: '',
arriveAt: '',
routeType: 'fastest',
travelMode: 'car',
vehicleCommercial: true,
vehicleEngineType: 'combustion',
vehicleWidth: 0,
vehicleHeight: 0,
vehicleLength: 0,
vehicleWeight: 1600
};
Interestingly, this does work if the avoid property is set to a string, but this only allows us to pass one avoid through to the routing.
Am I missing something? Is it possible to specify multiple avoids through the calculateRouteDirection() function?