Skip to content

Commit

Permalink
Fix formatting typo in API.md (#253)
Browse files Browse the repository at this point in the history
* Fix formatting typo in Geocoder#on docstring

* generate API.md doc

* fix typo in directions.js file

Co-authored-by: malwoodsantoro <[email protected]>
  • Loading branch information
adrianababakanian and malwoodsantoro authored Jul 21, 2020
1 parent 7fa85ae commit d7fa9dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ The Directions control
- `options.controls.instructions` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hide or display the instructions control. (optional, default `true`)
- `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`)
- `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`)
- `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"`)
- `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"`)
- `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"`)
- `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`)
- `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`)
- `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`)
- `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`)

**Examples**

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

**Parameters**

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

Returns **[MapboxDirections](#mapboxdirections)** this;
2 changes: 1 addition & 1 deletion src/controls/geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default class Geocoder {
* - __loading__ `Emitted when the geocoder is looking up a query`
* - __results__ `{ results } Fired when the geocoder returns a response`
* - __result__ `{ result } Fired when input is set`
* - __error__ `{ error } Error as string
* - __error__ `{ error } Error as string`
* @param {Function} fn function that's called when the event is emitted.
* @returns {Geocoder} this;
*/
Expand Down
2 changes: 1 addition & 1 deletion src/directions.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export default class MapboxDirections {
* - __origin__ `{ feature } Fired when origin is set`
* - __destination__ `{ feature } Fired when destination is set`
* - __route__ `{ route } Fired when a route is updated`
* - __error__ `{ error } Error as string
* - __error__ `{ error } Error as string`
* @param {Function} fn function that's called when the event is emitted.
* @returns {MapboxDirections} this;
*/
Expand Down

0 comments on commit d7fa9dd

Please sign in to comment.