From b0c3051b1b55cf20e801552fc5f0d2560b84efe8 Mon Sep 17 00:00:00 2001 From: David Martin Date: Fri, 3 Mar 2017 09:45:51 +0800 Subject: [PATCH] Added support for Mapbox radiuses parameter To add this during the setup of the L.Routing.mapbox constructor add include the radiuses parameter. e.g. L.Routing.mapbox(mapbox_token, { radiuses: 3000 }) Mapbox Radiuses - Maximum distance in meters that each coordinate is allowed to move when snapped to a nearby road segment. Allows the ability to generate an error for an unreachable road segment. rather than creating a straight line. --- src/osrm-v1.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osrm-v1.js b/src/osrm-v1.js index bf79258c..8f35cd8b 100644 --- a/src/osrm-v1.js +++ b/src/osrm-v1.js @@ -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(';') : '') + (options.allowUTurns ? '&continue_straight=' + !options.allowUTurns : ''); },