I am using this plugin. Other than routing which I use Directions API router, it works fine, but I also want to use Optimization API, so I changed serviceurl and added profile. The error that happens is that in the query parameter, there's a alternatives parameter all the time, doesn't matter what I pass in which causes mapbox to return 422 error (query parameters wrong).
I looked through the code and here is what's written:
return this.options.serviceUrl + '/' + this.options.profile + '/' +
locs.join(';') + '?' +
(options.geometryOnly ? (options.simplifyGeometry ? '' : 'overview=full') : 'overview=false') +
'&alternatives=' + computeAlternative.toString() +
'&steps=' + computeInstructions.toString() +
(this.options.useHints ? '&hints=' + hints.join(';') : '') +
(options.allowUTurns ? '&continue_straight=' + !options.allowUTurns : '');
So alternatives is always true. how do I fix it or will i even be able to use this plugin for optimization api? Same thing was asked here: https://github.com/perliedman/leaflet-routing-machine/pull/534
Hi .
I am using this plugin. Other than routing which I use Directions API router, it works fine, but I also want to use Optimization API, so I changed serviceurl and added profile. The error that happens is that in the query parameter, there's a alternatives parameter all the time, doesn't matter what I pass in which causes mapbox to return 422 error (query parameters wrong).
I looked through the code and here is what's written: