Skip to content

Commit 2748a78

Browse files
committed
Expose general custom options
Expose general custom options to support new API parameters not yet supported by this SDK
1 parent a1c9c5f commit 2748a78

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/actions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function setHoverMarker(feature) {
6060

6161
function fetchDirections() {
6262
return (dispatch, getState) => {
63-
const { api, accessToken, routeIndex, profile, alternatives, congestion, destination, language, exclude, byond_recipe_name, fetchDirectionsRequest } = getState();
63+
const { api, accessToken, routeIndex, profile, alternatives, congestion, destination, language, exclude, custom_options, fetchDirectionsRequest } = getState();
6464
// if there is no destination set, do not make request because it will fail
6565
if (!(destination && destination.geometry)) return;
6666

@@ -81,7 +81,7 @@ function fetchDirections() {
8181
if (language) options.push('language='+language);
8282
if (exclude) options.push('exclude=' + exclude);
8383
if (accessToken) options.push('access_token=' + accessToken);
84-
if (byond_recipe_name) options.push('byond_recipe_name=' + byond_recipe_name);
84+
if (custom_options) options.push(custom_options);
8585

8686
const request = new XMLHttpRequest();
8787
request.open('GET', `${api}${profile}/${query}.json?${options.join('&')}`, true);

src/directions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Instructions from './controls/instructions';
3939
* @param {String} [options.placeholderDestination="Choose destination"] If set, this text will appear as the placeholder attribute for the destination input element.
4040
* @param {Boolean} [options.flyTo=true] If false, animating the map to a selected result is disabled.
4141
* @param {String} [options.exclude=null] Exclude certain road types from routing. The default is to not exclude anything. Search for `exclude` in `optional parameters`: https://docs.mapbox.com/api/navigation/#retrieve-directions
42-
* @param {String} [options.byond_recipe_name=null] Only works in combination with driving or driving-traffic movement profile. Set the byond recipe name to use when requesting directions.
42+
* @param {String} [options.custom_options=null] Add custom URL parameters that are supported by the Directions API
4343
* @param {number | PaddingOptions} [options.routePadding=80] Specify padding surrounding route. A single number of pixels or a [PaddingOptions](https://docs.mapbox.com/mapbox-gl-js/api/#paddingoptions) object.
4444
* @example
4545
* var MapboxDirections = require('../src/index');

0 commit comments

Comments
 (0)