From 1fa2958815bf72d93622a681aa0735324a4cc06a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 6 Oct 2015 22:07:58 -0400 Subject: [PATCH] Fire mousedown and mouseup (closes #1411) --- js/ui/interaction.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/ui/interaction.js b/js/ui/interaction.js index c034b000336..a24324a4243 100644 --- a/js/ui/interaction.js +++ b/js/ui/interaction.js @@ -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. * @@ -151,6 +173,7 @@ Interaction.prototype = { _onMouseDown: function (e) { this._startPos = DOM.mousePos(this._el, e); + this._fireEvent('mousedown', e); }, _onMouseUp: function (e) { @@ -158,6 +181,7 @@ Interaction.prototype = { this._fireEvent('contextmenu', e); this._contextMenuFired = null; + this._fireEvent('mouseup', e); }, _onTouchStart: function (e) {