Skip to content

Commit

Permalink
Fire mousedown and mouseup (closes #1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhousel committed Nov 13, 2015
1 parent cab6ef8 commit 1fa2958
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions js/ui/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ var DOM = require('../util/dom'),

module.exports = Interaction;

/**
* Mouse down event.
*
* @event mousedown
* @memberof Map
* @type {Object}
* @property {Point} point the pixel location of the event
* @property {LngLat} lngLat the geographic location of the event
* @property {Event} originalEvent the original DOM event
*/

/**
* Mouse up event.
*
* @event mouseup
* @memberof Map
* @type {Object}
* @property {Point} point the pixel location of the event
* @property {LngLat} lngLat the geographic location of the event
* @property {Event} originalEvent the original DOM event
*/

/**
* Mouse move event.
*
Expand Down Expand Up @@ -151,13 +173,15 @@ Interaction.prototype = {

_onMouseDown: function (e) {
this._startPos = DOM.mousePos(this._el, e);
this._fireEvent('mousedown', e);
},

_onMouseUp: function (e) {
if (this._contextMenuFired && !this._map.dragRotate.active && !this._map.dragPan.active)
this._fireEvent('contextmenu', e);

this._contextMenuFired = null;
this._fireEvent('mouseup', e);
},

_onTouchStart: function (e) {
Expand Down

0 comments on commit 1fa2958

Please sign in to comment.