mapbox-gl-directions icon indicating copy to clipboard operation
mapbox-gl-directions copied to clipboard

Walking and cycling errors when excluding motorways

Open dethier1958 opened this issue 8 months ago • 0 comments

When doing a route with the cycling or walking profile, if directions was set up to exclude motorways, there is an error message. For walking, the error is "exclude value must be one of: ferry, cash_only_tolls, border_crossing, country_border, state_border" and for cycling, the error is "exclude value must be one of: ferry, cash_only_tolls, unpaved"

I allow the user to choose those exclusions, and these errors likely won't make sense to a user. It took me a while to figure out what they meant!

I wonder if it would be possible, when using the walking or cycling profiles to filter out invalid exclude parameters before sending the request to avoid these errors. Looks like perhaps around line 82 in index.js there could be code inserted to remove exclude parameters that do not work for the current profile.

dethier1958 avatar Feb 16 '25 20:02 dethier1958