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:
@@ -1,8 +1,8 @@
|
||||
goog.provide('ol.Image');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.ImageBase');
|
||||
goog.require('ol.ImageState');
|
||||
@@ -49,7 +49,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<goog.events.Key>}
|
||||
* @type {Array.<ol.events.Key>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
@@ -131,9 +131,9 @@ ol.Image.prototype.load = function() {
|
||||
goog.asserts.assert(!this.imageListenerKeys_,
|
||||
'this.imageListenerKeys_ should be null');
|
||||
this.imageListenerKeys_ = [
|
||||
goog.events.listenOnce(this.image_, goog.events.EventType.ERROR,
|
||||
ol.events.listenOnce(this.image_, ol.events.EventType.ERROR,
|
||||
this.handleImageError_, false, this),
|
||||
goog.events.listenOnce(this.image_, goog.events.EventType.LOAD,
|
||||
ol.events.listenOnce(this.image_, ol.events.EventType.LOAD,
|
||||
this.handleImageLoad_, false, this)
|
||||
];
|
||||
this.imageLoadFunction_(this, this.src_);
|
||||
@@ -157,6 +157,6 @@ ol.Image.prototype.setImage = function(image) {
|
||||
ol.Image.prototype.unlistenImage_ = function() {
|
||||
goog.asserts.assert(this.imageListenerKeys_,
|
||||
'this.imageListenerKeys_ should not be null');
|
||||
this.imageListenerKeys_.forEach(goog.events.unlistenByKey);
|
||||
this.imageListenerKeys_.forEach(ol.events.unlistenByKey);
|
||||
this.imageListenerKeys_ = null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user