Replace goog.events.Event/EventTarget system with our own
This also removes goog.events.listen, goog.events.unlisten, goog.events.unlistenByKey and goog.events.BrowserEvent.
This commit is contained in:
@@ -2,9 +2,9 @@ goog.provide('ol.interaction.Modify');
|
||||
goog.provide('ol.interaction.ModifyEvent');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.Event');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.Event');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Collection');
|
||||
@@ -55,7 +55,7 @@ ol.ModifyEventType = {
|
||||
* this type.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {goog.events.Event}
|
||||
* @extends {ol.events.Event}
|
||||
* @implements {oli.ModifyEvent}
|
||||
* @param {ol.ModifyEventType} type Type.
|
||||
* @param {ol.Collection.<ol.Feature>} features The features modified.
|
||||
@@ -80,7 +80,7 @@ ol.interaction.ModifyEvent = function(type, features, mapBrowserPointerEvent) {
|
||||
*/
|
||||
this.mapBrowserPointerEvent = mapBrowserPointerEvent;
|
||||
};
|
||||
goog.inherits(ol.interaction.ModifyEvent, goog.events.Event);
|
||||
goog.inherits(ol.interaction.ModifyEvent, ol.events.Event);
|
||||
|
||||
|
||||
/**
|
||||
@@ -229,9 +229,9 @@ ol.interaction.Modify = function(options) {
|
||||
this.features_ = options.features;
|
||||
|
||||
this.features_.forEach(this.addFeature_, this);
|
||||
goog.events.listen(this.features_, ol.CollectionEventType.ADD,
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.ADD,
|
||||
this.handleFeatureAdd_, false, this);
|
||||
goog.events.listen(this.features_, ol.CollectionEventType.REMOVE,
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.REMOVE,
|
||||
this.handleFeatureRemove_, false, this);
|
||||
|
||||
};
|
||||
@@ -251,7 +251,7 @@ ol.interaction.Modify.prototype.addFeature_ = function(feature) {
|
||||
if (map) {
|
||||
this.handlePointerAtPixel_(this.lastPixel_, map);
|
||||
}
|
||||
goog.events.listen(feature, goog.events.EventType.CHANGE,
|
||||
ol.events.listen(feature, ol.events.EventType.CHANGE,
|
||||
this.handleFeatureChange_, false, this);
|
||||
};
|
||||
|
||||
@@ -281,7 +281,7 @@ ol.interaction.Modify.prototype.removeFeature_ = function(feature) {
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
goog.events.unlisten(feature, goog.events.EventType.CHANGE,
|
||||
ol.events.unlisten(feature, ol.events.EventType.CHANGE,
|
||||
this.handleFeatureChange_, false, this);
|
||||
};
|
||||
|
||||
@@ -330,7 +330,7 @@ ol.interaction.Modify.prototype.handleFeatureAdd_ = function(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {goog.events.Event} evt Event.
|
||||
* @param {ol.events.Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.Modify.prototype.handleFeatureChange_ = function(evt) {
|
||||
|
||||
Reference in New Issue
Block a user