From c4d6e04e4beab5f6cabdba265f233a012402fba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Tue, 7 Oct 2014 10:17:58 +0200 Subject: [PATCH 1/2] Do not rename handleMapBrowserEvent internally --- externs/oli.js | 15 +++++++++++++++ src/ol/interaction/interaction.js | 2 ++ 2 files changed, 17 insertions(+) diff --git a/externs/oli.js b/externs/oli.js index 4be5f74d8d..097ea7bf62 100644 --- a/externs/oli.js +++ b/externs/oli.js @@ -122,6 +122,7 @@ oli.control.Control = function() {}; oli.control.Control.prototype.setMap = function(map) {}; + /** * @type {Object} */ @@ -129,6 +130,20 @@ oli.interaction; +/** + * @interface + */ +oli.interaction.Interaction = function() {}; + +/** + * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. + * @return {boolean} Whether the map browser event should continue + * through the chain of interactions. false means stop, true + * means continue. + */ +oli.interaction.Interaction.prototype.handleMapBrowserEvent = function(e) {}; + + /** * @interface */ diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index 9b41a7d2de..3cdc0c32d1 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -33,6 +33,7 @@ ol.interaction.InteractionProperty = { * * @constructor * @extends {ol.Object} + * @implements {oli.interaction.Interaction} * @api */ ol.interaction.Interaction = function() { @@ -80,6 +81,7 @@ ol.interaction.Interaction.prototype.getMap = function() { * @return {boolean} Whether the map browser event should continue * through the chain of interactions. false means stop, true * means continue. + * @api */ ol.interaction.Interaction.prototype.handleMapBrowserEvent = goog.abstractMethod; From f32c550dbe75ded725f698c9cdf658218ec65d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sun, 9 Nov 2014 22:08:29 +0100 Subject: [PATCH 2/2] Better docs for handleMapBrowserEvent --- externs/oli.js | 2 +- src/ol/interaction/interaction.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/externs/oli.js b/externs/oli.js index 097ea7bf62..8346fbe7e2 100644 --- a/externs/oli.js +++ b/externs/oli.js @@ -138,7 +138,7 @@ oli.interaction.Interaction = function() {}; /** * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} Whether the map browser event should continue - * through the chain of interactions. false means stop, true + * through the chain of interactions. `false` means stop, `true` * means continue. */ oli.interaction.Interaction.prototype.handleMapBrowserEvent = function(e) {}; diff --git a/src/ol/interaction/interaction.js b/src/ol/interaction/interaction.js index 3cdc0c32d1..76b15d261b 100644 --- a/src/ol/interaction/interaction.js +++ b/src/ol/interaction/interaction.js @@ -77,10 +77,15 @@ ol.interaction.Interaction.prototype.getMap = function() { /** + * Method called by the map to notify the interaction that a browser + * event was dispatched on the map. If the interaction wants to handle + * that event it can return `false` to prevent the propagation of the + * event to other interactions in the map's interactions chain. * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} Whether the map browser event should continue - * through the chain of interactions. false means stop, true + * through the chain of interactions. `false` means stop, `true` * means continue. + * @function * @api */ ol.interaction.Interaction.prototype.handleMapBrowserEvent =