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:
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user