You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -39,10 +39,12 @@ The Directions control
39
39
-`options.controls.instructions`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hide or display the instructions control. (optional, default `true`)
40
40
-`options.controls.profileSwitcher`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hide or display the default profile switch with options for traffic, driving, walking and cycling. (optional, default `true`)
41
41
-`options.zoom`**[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** If no bbox exists from the geocoder result, the zoom you set here will be used in the flyTo. (optional, default `16`)
42
+
-`options.language`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The language of returned turn-by-turn text instructions. See supported languages : <https://docs.mapbox.com/api/navigation/#instructions-languages> (optional, default `"en"`)
42
43
-`options.placeholderOrigin`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** If set, this text will appear as the placeholder attribute for the origin input element. (optional, default `"Choose a starting place"`)
43
44
-`options.placeholderDestination`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** If set, this text will appear as the placeholder attribute for the destination input element. (optional, default `"Choose destination"`)
44
45
-`options.flyTo`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If false, animating the map to a selected result is disabled. (optional, default `true`)
45
-
-`options.exclude`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Exclude certain road types from routing. The default is to not exclude anything. Options: `ferry`, `toll`, `motorway` (optional, default `null`)
46
+
-`options.exclude`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 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> (optional, default `null`)
47
+
-`options.routePadding`**([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | PaddingOptions)** Specify padding surrounding route. A single number of pixels or a [PaddingOptions](https://docs.mapbox.com/mapbox-gl-js/api/#paddingoptions) object. (optional, default `80`)
46
48
47
49
**Examples**
48
50
@@ -173,14 +175,13 @@ Subscribe to events that happen within the plugin.
173
175
174
176
**Parameters**
175
177
176
-
-`type`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of event. Available events and the data passed into their respective event objects are:-
177
-
-**clear**`{ type: } Type is one of 'origin' or 'destination'`
178
+
-`type`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of event. Available events and the data passed into their respective event objects are:- **clear**`{ type: } Type is one of 'origin' or 'destination'`
178
179
-**loading**`{ type: } Type is one of 'origin' or 'destination'`
179
180
-**profile**`{ profile } Profile is one of 'driving', 'walking', or 'cycling'`
180
181
-**origin**`{ feature } Fired when origin is set`
181
182
-**destination**`{ feature } Fired when destination is set`
182
183
-**route**`{ route } Fired when a route is updated`
183
-
-**error**\`{ error } Error as string
184
+
-**error**`{ error } Error as string`
184
185
-`fn`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** function that's called when the event is emitted.
0 commit comments