The Wayback Machine - https://web.archive.org/web/20201210215256/https://github.com/mapbox/mapbox-directions-swift/issues/249
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging when attempting to use 3+ waypoints #249

Open
captainbarbosa opened this issue Mar 14, 2018 · 2 comments
Open

Improve error messaging when attempting to use 3+ waypoints #249

captainbarbosa opened this issue Mar 14, 2018 · 2 comments

Comments

@captainbarbosa
Copy link
Contributor

@captainbarbosa captainbarbosa commented Mar 14, 2018

If a developer attempts to calculate directions with more than three waypoints, the following error is returned:

Error Domain=MBDirectionsErrorDomain Code=-1 "Too many coordinates;
maximum number of coordinates is 3." 
UserInfo={NSLocalizedFailureReason=Too many coordinates;
maximum number of coordinates is 3.}

It appears the Mapbox Directions API doesn't allow for using more than three waypoints in a directions calculation if the profile is set to automobileAvoidingTraffic. It would be useful if this was more clearly stated in the error message.

@ReSpawN
Copy link

@ReSpawN ReSpawN commented Feb 11, 2019

@captainbarbosa Thanks so much for posting this, it completely wrecked my brain searching for a solution.

@vishalagrawal11
Copy link

@vishalagrawal11 vishalagrawal11 commented Oct 24, 2019

Set Profile while getRoute to

.profile(DirectionsCriteria.PROFILE_DRIVING)

Will allow you to add multiple way points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.