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

Add support for Mapbox radiuses parameter #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/osrm-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
'&alternatives=' + computeAlternative.toString() +
'&steps=' + computeInstructions.toString() +
(this.options.useHints ? '&hints=' + hints.join(';') : '') +
(this.options.radiuses ? '&radiuses=' + locs.fill(this.options.radiuses).join(';') : '') +
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.prototype.fill is an ES6 method, and not supported in any IE version according to (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/fill); Leaflet Routing Machine still supports quite old IE versions.

Also, note that fill operates in place, overwriting the array - while this works in this case, it's setting up a trap for future modifications.

So, please use something more old school :)

(options.allowUTurns ? '&continue_straight=' + !options.allowUTurns : '');
},

Expand Down