Skip to content

Commit

Permalink
[docsprint] Add example to MapMouseEvent (#9595)
Browse files Browse the repository at this point in the history
* add example to MapMouseEvent

* fix linting error

* fix copy paste error
  • Loading branch information
Colleen McGinnis authored Apr 20, 2020
1 parent 176e092 commit e8aab02
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/ui/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,27 @@ import type LngLat from '../geo/lng_lat';
/**
* `MapMouseEvent` is the event type for mouse-related map events.
* @extends {Object}
* @example
* // The `click` event is an example of a `MapMouseEvent`.
* // Set up an event listener on the map.
* map.on('click', function(e) {
* // The event object (`e`) contains information like the
* // coordinates of the point on the map that was clicked.
* console.log('A click event has occurred at ' + e.lngLat);
* });
*/
export class MapMouseEvent extends Event {
/**
* The event type.
* The event type (one of [`mousedown`](#map.event:mousedown),
* [`mouseup`](#map.event:mouseup),
* [`click`](#map.event:click),
* [`dblclick`](#map.event:dblclick),
* [`mousemove`](#map.event:mousemove),
* [`mouseover`](#map.event:mouseover),
* [`mouseenter`](#map.event:mouseenter),
* [`mouseleave`](#map.event:mouseleave),
* [`mouseout`](#map.event:mouseout),
* [`contextmenu`](#map.event:contextmenu)).
*/
type: 'mousedown'
| 'mouseup'
Expand Down

0 comments on commit e8aab02

Please sign in to comment.