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:
Andreas Hocevar
2016-01-29 16:29:46 +01:00
parent d87482e415
commit 3f2d79b7fe
110 changed files with 1143 additions and 733 deletions

View File

@@ -3,8 +3,8 @@
goog.provide('ol.Geolocation');
goog.provide('ol.GeolocationProperty');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.Coordinate');
goog.require('ol.Object');
goog.require('ol.geom.Geometry');
@@ -83,10 +83,10 @@ ol.Geolocation = function(opt_options) {
*/
this.watchId_ = undefined;
goog.events.listen(
ol.events.listen(
this, ol.Object.getChangeEventType(ol.GeolocationProperty.PROJECTION),
this.handleProjectionChanged_, false, this);
goog.events.listen(
ol.events.listen(
this, ol.Object.getChangeEventType(ol.GeolocationProperty.TRACKING),
this.handleTrackingChanged_, false, this);
@@ -189,9 +189,9 @@ ol.Geolocation.prototype.positionChange_ = function(position) {
* @param {GeolocationPositionError} error error object.
*/
ol.Geolocation.prototype.positionError_ = function(error) {
error.type = goog.events.EventType.ERROR;
error.type = ol.events.EventType.ERROR;
this.setTracking(false);
this.dispatchEvent(error);
this.dispatchEvent(/** @type {{type: string}} */ (error));
};