Skip to content

Commit d7fa9dd

Browse files
Fix formatting typo in API.md (#253)
* Fix formatting typo in Geocoder#on docstring * generate API.md doc * fix typo in directions.js file Co-authored-by: malwoodsantoro <mallorywood413@gmail.com>
1 parent 7fa85ae commit d7fa9dd

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

API.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ The Directions control
3939
- `options.controls.instructions` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hide or display the instructions control. (optional, default `true`)
4040
- `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`)
4141
- `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"`)
4243
- `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"`)
4344
- `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"`)
4445
- `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`)
4648

4749
**Examples**
4850

@@ -173,14 +175,13 @@ Subscribe to events that happen within the plugin.
173175

174176
**Parameters**
175177

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'`
178179
- **loading** `{ type: } Type is one of 'origin' or 'destination'`
179180
- **profile** `{ profile } Profile is one of 'driving', 'walking', or 'cycling'`
180181
- **origin** `{ feature } Fired when origin is set`
181182
- **destination** `{ feature } Fired when destination is set`
182183
- **route** `{ route } Fired when a route is updated`
183-
- **error** \`{ error } Error as string
184+
- **error** `{ error } Error as string`
184185
- `fn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** function that's called when the event is emitted.
185186

186187
Returns **[MapboxDirections](#mapboxdirections)** this;

src/controls/geocoder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export default class Geocoder {
226226
* - __loading__ `Emitted when the geocoder is looking up a query`
227227
* - __results__ `{ results } Fired when the geocoder returns a response`
228228
* - __result__ `{ result } Fired when input is set`
229-
* - __error__ `{ error } Error as string
229+
* - __error__ `{ error } Error as string`
230230
* @param {Function} fn function that's called when the event is emitted.
231231
* @returns {Geocoder} this;
232232
*/

src/directions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ export default class MapboxDirections {
550550
* - __origin__ `{ feature } Fired when origin is set`
551551
* - __destination__ `{ feature } Fired when destination is set`
552552
* - __route__ `{ route } Fired when a route is updated`
553-
* - __error__ `{ error } Error as string
553+
* - __error__ `{ error } Error as string`
554554
* @param {Function} fn function that's called when the event is emitted.
555555
* @returns {MapboxDirections} this;
556556
*/

0 commit comments

Comments
 (0)