From e9c4ac2a40897a12e78b75b7202da8a60e0b85f6 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 14 Nov 2017 15:19:39 +0100 Subject: [PATCH 1/2] Remove goog.events usage in ngeo.interaction.Rotate --- src/ol-ext/interaction/rotate.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ol-ext/interaction/rotate.js b/src/ol-ext/interaction/rotate.js index 248b7d11e98..eb600809af0 100644 --- a/src/ol-ext/interaction/rotate.js +++ b/src/ol-ext/interaction/rotate.js @@ -3,7 +3,6 @@ goog.provide('ngeo.RotateEventType'); goog.provide('ngeo.interaction.Rotate'); goog.require('goog.asserts'); -goog.require('goog.events'); goog.require('ol'); goog.require('ol.Collection'); goog.require('ol.Feature'); @@ -86,7 +85,7 @@ ngeo.interaction.Rotate = function(options) { this.modified_ = false; /** - * @type {?goog.events.Key} + * @type {?ol.EventsKey} * @private */ this.keyPressListenerKey_ = null; @@ -173,18 +172,17 @@ ol.inherits(ngeo.interaction.Rotate, ol.interaction.Pointer); ngeo.interaction.Rotate.prototype.setActive = function(active) { if (this.keyPressListenerKey_) { - goog.events.unlistenByKey(this.keyPressListenerKey_); + ol.events.unlistenByKey(this.keyPressListenerKey_); this.keyPressListenerKey_ = null; } ol.interaction.Pointer.prototype.setActive.call(this, active); if (active) { - this.keyPressListenerKey_ = goog.events.listen( + this.keyPressListenerKey_ = ol.events.listen( document, 'keyup', this.handleKeyUp_, - false, this ); this.features_.forEach(this.addFeature_, this); @@ -396,7 +394,7 @@ ngeo.interaction.Rotate.prototype.handleUp_ = function(evt) { /** * Deactivate this interaction if the ESC key is pressed. - * @param {goog.events.Event} evt Event. + * @param {KeyboardEvent} evt Event. * @private */ ngeo.interaction.Rotate.prototype.handleKeyUp_ = function(evt) { From 02ce6048fee589bda74c7cac95a59a386e1170f3 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 14 Nov 2017 15:21:34 +0100 Subject: [PATCH 2/2] Remove goog.events usage in ngeo.interaction.Translate --- src/ol-ext/interaction/translate.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ol-ext/interaction/translate.js b/src/ol-ext/interaction/translate.js index bf50064db07..8b389350917 100644 --- a/src/ol-ext/interaction/translate.js +++ b/src/ol-ext/interaction/translate.js @@ -1,6 +1,7 @@ goog.provide('ngeo.interaction.Translate'); goog.require('ol.Feature'); +goog.require('ol.events'); goog.require('ol.geom.LineString'); goog.require('ol.geom.Point'); goog.require('ol.geom.Polygon'); @@ -38,7 +39,7 @@ ngeo.interaction.Translate = function(options) { this.featureListenerKeys_ = {}; /** - * @type {?goog.events.Key} + * @type {?ol.EventsKey} * @private */ this.keyPressListenerKey_ = null; @@ -89,18 +90,17 @@ ol.inherits(ngeo.interaction.Translate, ol.interaction.Translate); ngeo.interaction.Translate.prototype.setActive = function(active) { if (this.keyPressListenerKey_) { - goog.events.unlistenByKey(this.keyPressListenerKey_); + ol.events.unlistenByKey(this.keyPressListenerKey_); this.keyPressListenerKey_ = null; } ol.interaction.Translate.prototype.setActive.call(this, active); if (active) { - this.keyPressListenerKey_ = goog.events.listen( + this.keyPressListenerKey_ = ol.events.listen( document, 'keyup', this.handleKeyUp_, - false, this ); } @@ -272,7 +272,7 @@ ngeo.interaction.Translate.prototype.getGeometryCenterPoint_ = function( /** * Deactivate this interaction if the ESC key is pressed. - * @param {goog.events.Event} evt Event. + * @param {KeyboardEvent} evt Event. * @private */ ngeo.interaction.Translate.prototype.handleKeyUp_ = function(evt) {