mapbox / mapbox/mapbox-gl-directions

Walking and cycling errors when excluding motorways

Open
#323 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged enhancement
Dominant language
JavaScript
Stars
255
Forks
130
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in index.js around line 82, where request parameters are assembled, and trace how exclude values are passed for walking and cycling profiles. Done means unsupported motorway exclusions are removed before the request is sent, so those profiles no longer produce the reported validation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.