diff --git a/src/ol/control/attributioncontrol.js b/src/ol/control/attributioncontrol.js index 1d02639c1c..2aec3d73c8 100644 --- a/src/ol/control/attributioncontrol.js +++ b/src/ol/control/attributioncontrol.js @@ -95,8 +95,7 @@ ol.control.Attribution = function(opt_options) { 'title': tipLabel }, activeLabel); - ol.events.listen(button, ol.events.EventType.CLICK, - this.handleClick_, false, this); + ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this); var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL + diff --git a/src/ol/control/control.js b/src/ol/control/control.js index 75e214ae49..9fe4232b91 100644 --- a/src/ol/control/control.js +++ b/src/ol/control/control.js @@ -118,7 +118,7 @@ ol.control.Control.prototype.setMap = function(map) { target.appendChild(this.element); if (this.render !== ol.nullFunction) { this.listenerKeys.push(ol.events.listen(map, - ol.MapEventType.POSTRENDER, this.render, false, this)); + ol.MapEventType.POSTRENDER, this.render, this)); } map.render(); } diff --git a/src/ol/control/fullscreencontrol.js b/src/ol/control/fullscreencontrol.js index d7ea480326..af7a210437 100644 --- a/src/ol/control/fullscreencontrol.js +++ b/src/ol/control/fullscreencontrol.js @@ -65,11 +65,11 @@ ol.control.FullScreen = function(opt_options) { }, this.labelNode_); ol.events.listen(button, ol.events.EventType.CLICK, - this.handleClick_, false, this); + this.handleClick_, this); ol.events.listen(goog.global.document, goog.dom.fullscreen.EventType.CHANGE, - this.handleFullScreenChange_, false, this); + this.handleFullScreenChange_, this); var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL + ' ' + diff --git a/src/ol/control/mousepositioncontrol.js b/src/ol/control/mousepositioncontrol.js index 279763626b..0b01944e34 100644 --- a/src/ol/control/mousepositioncontrol.js +++ b/src/ol/control/mousepositioncontrol.js @@ -55,7 +55,7 @@ ol.control.MousePosition = function(opt_options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.control.MousePositionProperty.PROJECTION), - this.handleProjectionChanged_, false, this); + this.handleProjectionChanged_, this); if (options.coordinateFormat) { this.setCoordinateFormat(options.coordinateFormat); @@ -184,9 +184,9 @@ ol.control.MousePosition.prototype.setMap = function(map) { var viewport = map.getViewport(); this.listenerKeys.push( ol.events.listen(viewport, ol.events.EventType.MOUSEMOVE, - this.handleMouseMove, false, this), + this.handleMouseMove, this), ol.events.listen(viewport, ol.events.EventType.MOUSEOUT, - this.handleMouseOut, false, this) + this.handleMouseOut, this) ); } }; diff --git a/src/ol/control/overviewmapcontrol.js b/src/ol/control/overviewmapcontrol.js index 35072d5532..33e4a6a6d5 100644 --- a/src/ol/control/overviewmapcontrol.js +++ b/src/ol/control/overviewmapcontrol.js @@ -84,7 +84,7 @@ ol.control.OverviewMap = function(opt_options) { }, activeLabel); ol.events.listen(button, ol.events.EventType.CLICK, - this.handleClick_, false, this); + this.handleClick_, this); var ovmapDiv = goog.dom.createDom('DIV', 'ol-overviewmap-map'); @@ -161,7 +161,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) { if (map) { this.listenerKeys.push(ol.events.listen( map, ol.ObjectEventType.PROPERTYCHANGE, - this.handleMapPropertyChange_, false, this)); + this.handleMapPropertyChange_, this)); // TODO: to really support map switching, this would need to be reworked if (this.ovmap_.getLayers().getLength() === 0) { @@ -205,7 +205,7 @@ ol.control.OverviewMap.prototype.handleMapPropertyChange_ = function(event) { ol.control.OverviewMap.prototype.bindView_ = function(view) { ol.events.listen(view, ol.Object.getChangeEventType(ol.ViewProperty.ROTATION), - this.handleRotationChanged_, false, this); + this.handleRotationChanged_, this); }; @@ -217,7 +217,7 @@ ol.control.OverviewMap.prototype.bindView_ = function(view) { ol.control.OverviewMap.prototype.unbindView_ = function(view) { ol.events.unlisten(view, ol.Object.getChangeEventType(ol.ViewProperty.ROTATION), - this.handleRotationChanged_, false, this); + this.handleRotationChanged_, this); }; @@ -463,7 +463,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() { function(event) { this.updateBox_(); }, - false, this); + this); } }; diff --git a/src/ol/control/rotatecontrol.js b/src/ol/control/rotatecontrol.js index d851c24f43..6c6fd9086f 100644 --- a/src/ol/control/rotatecontrol.js +++ b/src/ol/control/rotatecontrol.js @@ -54,7 +54,7 @@ ol.control.Rotate = function(opt_options) { }, this.label_); ol.events.listen(button, ol.events.EventType.CLICK, - ol.control.Rotate.prototype.handleClick_, false, this); + ol.control.Rotate.prototype.handleClick_, this); var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL; diff --git a/src/ol/control/scalelinecontrol.js b/src/ol/control/scalelinecontrol.js index 3daac0c314..a5d0b3f650 100644 --- a/src/ol/control/scalelinecontrol.js +++ b/src/ol/control/scalelinecontrol.js @@ -111,7 +111,7 @@ ol.control.ScaleLine = function(opt_options) { ol.events.listen( this, ol.Object.getChangeEventType(ol.control.ScaleLineProperty.UNITS), - this.handleUnitsChanged_, false, this); + this.handleUnitsChanged_, this); this.setUnits(/** @type {ol.control.ScaleLineUnits} */ (options.units) || ol.control.ScaleLineUnits.METRIC); diff --git a/src/ol/control/zoomcontrol.js b/src/ol/control/zoomcontrol.js index f871854ace..d5418a3f85 100644 --- a/src/ol/control/zoomcontrol.js +++ b/src/ol/control/zoomcontrol.js @@ -44,7 +44,7 @@ ol.control.Zoom = function(opt_options) { ol.events.listen(inElement, ol.events.EventType.CLICK, goog.partial( - ol.control.Zoom.prototype.handleClick_, delta), false, this); + ol.control.Zoom.prototype.handleClick_, delta), this); var outElement = goog.dom.createDom('BUTTON', { 'class': className + '-out', @@ -54,7 +54,7 @@ ol.control.Zoom = function(opt_options) { ol.events.listen(outElement, ol.events.EventType.CLICK, goog.partial( - ol.control.Zoom.prototype.handleClick_, -delta), false, this); + ol.control.Zoom.prototype.handleClick_, -delta), this); var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL; diff --git a/src/ol/control/zoomslidercontrol.js b/src/ol/control/zoomslidercontrol.js index 75f59b4121..890f96aa5d 100644 --- a/src/ol/control/zoomslidercontrol.js +++ b/src/ol/control/zoomslidercontrol.js @@ -111,14 +111,14 @@ ol.control.ZoomSlider = function(opt_options) { this.registerDisposable(dragger); ol.events.listen(dragger, ol.pointer.EventType.POINTERDOWN, - this.handleDraggerStart_, false, this); + this.handleDraggerStart_, this); ol.events.listen(dragger, ol.pointer.EventType.POINTERMOVE, - this.handleDraggerDrag_, false, this); + this.handleDraggerDrag_, this); ol.events.listen(dragger, ol.pointer.EventType.POINTERUP, - this.handleDraggerEnd_, false, this); + this.handleDraggerEnd_, this); ol.events.listen(containerElement, ol.events.EventType.CLICK, - this.handleContainerClick_, false, this); + this.handleContainerClick_, this); ol.events.listen(thumbElement, ol.events.EventType.CLICK, ol.events.Event.stopPropagation); @@ -255,12 +255,12 @@ ol.control.ZoomSlider.prototype.handleDraggerStart_ = function(event) { ol.events.EventType.MOUSEMOVE, ol.events.EventType.TOUCHMOVE, ol.pointer.EventType.POINTERMOVE - ], this.handleDraggerDrag_, false, this), + ], this.handleDraggerDrag_, this), ol.events.listen(document, [ ol.events.EventType.MOUSEUP, ol.events.EventType.TOUCHEND, ol.pointer.EventType.POINTERUP - ], this.handleDraggerEnd_, false, this) + ], this.handleDraggerEnd_, this) ]; } } diff --git a/src/ol/control/zoomtoextentcontrol.js b/src/ol/control/zoomtoextentcontrol.js index e98e379039..f9b5f8f0e1 100644 --- a/src/ol/control/zoomtoextentcontrol.js +++ b/src/ol/control/zoomtoextentcontrol.js @@ -39,7 +39,7 @@ ol.control.ZoomToExtent = function(opt_options) { }, label); ol.events.listen(button, ol.events.EventType.CLICK, - this.handleClick_, false, this); + this.handleClick_, this); var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL; diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index 1c3414565c..b4f0205395 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -89,7 +89,7 @@ ol.DeviceOrientation = function(opt_options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.DeviceOrientationProperty.TRACKING), - this.handleTrackingChanged_, false, this); + this.handleTrackingChanged_, this); this.setTracking(options.tracking !== undefined ? options.tracking : false); @@ -209,7 +209,7 @@ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() { var tracking = this.getTracking(); if (tracking && !this.listenerKey_) { this.listenerKey_ = ol.events.listen(goog.global, 'deviceorientation', - this.orientationChange_, false, this); + this.orientationChange_, this); } else if (!tracking && this.listenerKey_ !== null) { ol.events.unlistenByKey(this.listenerKey_); this.listenerKey_ = null; diff --git a/src/ol/events.js b/src/ol/events.js index 36d088a98f..4b714271fb 100644 --- a/src/ol/events.js +++ b/src/ol/events.js @@ -125,20 +125,21 @@ ol.events.bindListener_ = function(listenerObj) { * * @param {!Array} listenerArray Array of listeners. * @param {!Function} listener The listener function. - * @param {boolean} useCapture The capture flag for the listener. * @param {Object=} opt_this The `this` value inside the listener. * @param {boolean=} opt_remove Remove the found listener from the array. + * @param {boolean=} opt_useCapture The capture flag for the listener. * @return {ol.events.ListenerObjType|undefined} The matching listener. * @private */ ol.events.findListener_ = function( - listenerArray, listener, useCapture, opt_this, opt_remove) { + listenerArray, listener, opt_this, opt_remove, opt_useCapture) { var listenerObj; + var useCapture = !!opt_useCapture; for (var i = 0, ii = listenerArray.length; i < ii; ++i) { listenerObj = listenerArray[i]; if (listenerObj.listener === listener && - listenerObj.useCapture == useCapture && - listenerObj.bindTo === opt_this) { + listenerObj.bindTo === opt_this && + listenerObj.useCapture === useCapture) { if (opt_remove) { listenerArray.splice(i, 1); } @@ -173,21 +174,21 @@ ol.events.getListeners = function(target, type) { * @param {ol.events.EventType|string|Array.<(ol.events.EventType|string)>} type * Event type. * @param {ol.events.ListenerFunctionType} listener Listener. - * @param {boolean=} opt_useCapture Use capture. For listeners on an - * {@link ol.events.EventTarget}, `true` simply means that the listener will - * be called before already registered listeners. Default is false. * @param {Object=} opt_this Object referenced by the `this` keyword in the * listener. Default is the `target`. * @param {boolean=} opt_once If true, add the listener as one-off listener. + * @param {boolean=} opt_useCapture Use capture. For listeners on an + * {@link ol.events.EventTarget}, `true` simply means that the listener will + * be called before already registered listeners. Default is false. * @return {ol.events.Key} Unique key for the listener. */ ol.events.listen = function( - target, type, listener, opt_useCapture, opt_this, opt_once) { + target, type, listener, opt_this, opt_once, opt_useCapture) { if (Array.isArray(type)) { var keys = []; type.forEach(function(t) { - keys.push(ol.events.listen(target, t, listener, opt_useCapture, opt_this, - opt_once)); + keys.push(ol.events.listen(target, t, listener, opt_this, opt_once, + opt_useCapture)); }); return keys; } @@ -201,8 +202,8 @@ ol.events.listen = function( if (!listenerArray) { listenerArray = listenerMap[type] = []; } - var listenerObj = ol.events.findListener_(listenerArray, listener, useCapture, - opt_this); + var listenerObj = ol.events.findListener_(listenerArray, listener, opt_this, + false, useCapture); if (listenerObj) { if (!opt_once) { // Turn one-off listener into a permanent one. @@ -243,17 +244,17 @@ ol.events.listen = function( * @param {ol.events.EventType|string|Array.<(ol.events.EventType|string)>} type * Event type. * @param {ol.events.ListenerFunctionType} listener Listener. + * @param {Object=} opt_this Object referenced by the `this` keyword in the + * listener. Default is the `target`. * @param {boolean=} opt_useCapture Use capture. For listeners on an * {@link ol.events.EventTarget}, `true` simply means that the listener will * be called before already registered listeners. Default is false. - * @param {Object=} opt_this Object referenced by the `this` keyword in the - * listener. Default is the `target`. * @return {ol.events.Key} Key for unlistenByKey. */ ol.events.listenOnce = function( - target, type, listener, opt_useCapture, opt_this) { - return ol.events.listen(target, type, listener, opt_useCapture, opt_this, - true); + target, type, listener, opt_this, opt_useCapture) { + return ol.events.listen(target, type, listener, opt_this, true, + opt_useCapture); }; @@ -268,17 +269,17 @@ ol.events.listenOnce = function( * @param {ol.events.EventType|string|Array.<(ol.events.EventType|string)>} type * Event type. * @param {ol.events.ListenerFunctionType} listener Listener. + * @param {Object=} opt_this Object referenced by the `this` keyword in the + * listener. Default is the `target`. * @param {boolean=} opt_useCapture Use capture. For listeners on an * {@link ol.events.EventTarget}, `true` simply means that the listener will * be called before already registered listeners. Default is false. - * @param {Object=} opt_this Object referenced by the `this` keyword in the - * listener. Default is the `target`. */ ol.events.unlisten = function( - target, type, listener, opt_useCapture, opt_this) { + target, type, listener, opt_this, opt_useCapture) { if (Array.isArray(type)) { type.forEach(function(t) { - ol.events.unlisten(target, t, listener, opt_useCapture, opt_this); + ol.events.unlisten(target, t, listener, opt_this, opt_useCapture); }); return; } @@ -286,7 +287,7 @@ ol.events.unlisten = function( var listenerArray = ol.events.getListeners(target, type); if (listenerArray) { var listenerObj = ol.events.findListener_(listenerArray, listener, - !!opt_useCapture, opt_this); + opt_this, false, !!opt_useCapture); if (listenerObj) { ol.events.unlistenByKey(listenerObj); } @@ -314,7 +315,7 @@ ol.events.unlistenByKey = function(key) { var listenerArray = ol.events.getListeners(key.target, key.type); if (listenerArray) { ol.events.findListener_(listenerArray, key.listener, - key.useCapture, key.bindTo, true); + key.bindTo, true, key.useCapture); if (listenerArray.length === 0) { var listenerMap = key.target[ol.events.LISTENER_MAP_PROP_]; delete listenerMap[key.type]; diff --git a/src/ol/feature.js b/src/ol/feature.js index f7f7699d87..3cd97ebd2c 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -93,7 +93,7 @@ ol.Feature = function(opt_geometryOrProperties) { ol.events.listen( this, ol.Object.getChangeEventType(this.geometryName_), - this.handleGeometryChanged_, false, this); + this.handleGeometryChanged_, this); if (opt_geometryOrProperties !== undefined) { if (opt_geometryOrProperties instanceof ol.geom.Geometry || @@ -215,7 +215,7 @@ ol.Feature.prototype.handleGeometryChanged_ = function() { var geometry = this.getGeometry(); if (geometry) { this.geometryChangeKey_ = ol.events.listen(geometry, - ol.events.EventType.CHANGE, this.handleGeometryChange_, false, this); + ol.events.EventType.CHANGE, this.handleGeometryChange_, this); } this.changed(); }; @@ -275,11 +275,11 @@ ol.Feature.prototype.setId = function(id) { ol.Feature.prototype.setGeometryName = function(name) { ol.events.unlisten( this, ol.Object.getChangeEventType(this.geometryName_), - this.handleGeometryChanged_, false, this); + this.handleGeometryChanged_, this); this.geometryName_ = name; ol.events.listen( this, ol.Object.getChangeEventType(this.geometryName_), - this.handleGeometryChanged_, false, this); + this.handleGeometryChanged_, this); this.handleGeometryChanged_(); }; diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index b02bb88f48..325d973207 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -85,10 +85,10 @@ ol.Geolocation = function(opt_options) { ol.events.listen( this, ol.Object.getChangeEventType(ol.GeolocationProperty.PROJECTION), - this.handleProjectionChanged_, false, this); + this.handleProjectionChanged_, this); ol.events.listen( this, ol.Object.getChangeEventType(ol.GeolocationProperty.TRACKING), - this.handleTrackingChanged_, false, this); + this.handleTrackingChanged_, this); if (options.projection !== undefined) { this.setProjection(ol.proj.get(options.projection)); diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index f023854740..02063c551b 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -58,7 +58,7 @@ ol.geom.GeometryCollection.prototype.unlistenGeometriesChange_ = function() { for (i = 0, ii = this.geometries_.length; i < ii; ++i) { ol.events.unlisten( this.geometries_[i], ol.events.EventType.CHANGE, - this.changed, false, this); + this.changed, this); } }; @@ -74,7 +74,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() { for (i = 0, ii = this.geometries_.length; i < ii; ++i) { ol.events.listen( this.geometries_[i], ol.events.EventType.CHANGE, - this.changed, false, this); + this.changed, this); } }; diff --git a/src/ol/image.js b/src/ol/image.js index 6fa986ef34..36d1036e03 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -132,9 +132,9 @@ ol.Image.prototype.load = function() { 'this.imageListenerKeys_ should be null'); this.imageListenerKeys_ = [ ol.events.listenOnce(this.image_, ol.events.EventType.ERROR, - this.handleImageError_, false, this), + this.handleImageError_, this), ol.events.listenOnce(this.image_, ol.events.EventType.LOAD, - this.handleImageLoad_, false, this) + this.handleImageLoad_, this) ]; this.imageLoadFunction_(this, this.src_); } diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index e4ca439b09..c92037f553 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -147,9 +147,9 @@ ol.ImageTile.prototype.load = function() { 'this.imageListenerKeys_ should be null'); this.imageListenerKeys_ = [ ol.events.listenOnce(this.image_, ol.events.EventType.ERROR, - this.handleImageError_, false, this), + this.handleImageError_, this), ol.events.listenOnce(this.image_, ol.events.EventType.LOAD, - this.handleImageLoad_, false, this) + this.handleImageLoad_, this) ]; this.tileLoadFunction_(this, this.src_); } diff --git a/src/ol/interaction/draganddropinteraction.js b/src/ol/interaction/draganddropinteraction.js index b1f867efcb..16819f9285 100644 --- a/src/ol/interaction/draganddropinteraction.js +++ b/src/ol/interaction/draganddropinteraction.js @@ -152,10 +152,10 @@ ol.interaction.DragAndDrop.prototype.setMap = function(map) { var dropArea = map.getViewport(); this.dropListenKeys_ = [ ol.events.listen(dropArea, ol.events.EventType.DROP, - ol.interaction.DragAndDrop.handleDrop_, false, this), + ol.interaction.DragAndDrop.handleDrop_, this), ol.events.listen(dropArea, [ol.events.EventType.DRAGENTER, ol.events.EventType.DRAGOVER, ol.events.EventType.DROP], - ol.interaction.DragAndDrop.handleStop_, false, this) + ol.interaction.DragAndDrop.handleStop_, this) ] } }; diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index 081e3faf56..79eab3e955 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -302,7 +302,7 @@ ol.interaction.Draw = function(options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.interaction.InteractionProperty.ACTIVE), - this.updateState_, false, this); + this.updateState_, this); }; goog.inherits(ol.interaction.Draw, ol.interaction.Pointer); diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index cff8ffd93a..de89fa523c 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -230,9 +230,9 @@ ol.interaction.Modify = function(options) { this.features_.forEach(this.addFeature_, this); ol.events.listen(this.features_, ol.CollectionEventType.ADD, - this.handleFeatureAdd_, false, this); + this.handleFeatureAdd_, this); ol.events.listen(this.features_, ol.CollectionEventType.REMOVE, - this.handleFeatureRemove_, false, this); + this.handleFeatureRemove_, this); }; goog.inherits(ol.interaction.Modify, ol.interaction.Pointer); @@ -252,7 +252,7 @@ ol.interaction.Modify.prototype.addFeature_ = function(feature) { this.handlePointerAtPixel_(this.lastPixel_, map); } ol.events.listen(feature, ol.events.EventType.CHANGE, - this.handleFeatureChange_, false, this); + this.handleFeatureChange_, this); }; @@ -282,7 +282,7 @@ ol.interaction.Modify.prototype.removeFeature_ = function(feature) { this.vertexFeature_ = null; } ol.events.unlisten(feature, ol.events.EventType.CHANGE, - this.handleFeatureChange_, false, this); + this.handleFeatureChange_, this); }; diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index 50168a1af1..47247ce55b 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -209,9 +209,9 @@ ol.interaction.Select = function(opt_options) { var features = this.featureOverlay_.getSource().getFeaturesCollection(); ol.events.listen(features, ol.CollectionEventType.ADD, - this.addFeature_, false, this); + this.addFeature_, this); ol.events.listen(features, ol.CollectionEventType.REMOVE, - this.removeFeature_, false, this); + this.removeFeature_, this); }; goog.inherits(ol.interaction.Select, ol.interaction.Interaction); diff --git a/src/ol/layer/heatmaplayer.js b/src/ol/layer/heatmaplayer.js index f069c019fb..7bdd5cafcd 100644 --- a/src/ol/layer/heatmaplayer.js +++ b/src/ol/layer/heatmaplayer.js @@ -74,7 +74,7 @@ ol.layer.Heatmap = function(opt_options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.layer.HeatmapLayerProperty.GRADIENT), - this.handleGradientChanged_, false, this); + this.handleGradientChanged_, this); this.setGradient(options.gradient ? options.gradient : ol.layer.Heatmap.DEFAULT_GRADIENT); @@ -86,7 +86,7 @@ ol.layer.Heatmap = function(opt_options) { ol.events.listen(this, [ ol.Object.getChangeEventType(ol.layer.HeatmapLayerProperty.BLUR), ol.Object.getChangeEventType(ol.layer.HeatmapLayerProperty.RADIUS) - ], this.handleStyleChanged_, false, this); + ], this.handleStyleChanged_, this); this.handleStyleChanged_(); @@ -129,8 +129,7 @@ ol.layer.Heatmap = function(opt_options) { // The render order is not relevant for a heatmap representation. this.setRenderOrder(null); - ol.events.listen(this, ol.render.EventType.RENDER, - this.handleRender_, false, this); + ol.events.listen(this, ol.render.EventType.RENDER, this.handleRender_, this); }; goog.inherits(ol.layer.Heatmap, ol.layer.Vector); diff --git a/src/ol/layer/layer.js b/src/ol/layer/layer.js index ca2aea7b29..61e53335d9 100644 --- a/src/ol/layer/layer.js +++ b/src/ol/layer/layer.js @@ -63,7 +63,7 @@ ol.layer.Layer = function(options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.layer.LayerProperty.SOURCE), - this.handleSourcePropertyChange_, false, this); + this.handleSourcePropertyChange_, this); var source = options.source ? options.source : null; this.setSource(source); @@ -145,7 +145,7 @@ ol.layer.Layer.prototype.handleSourcePropertyChange_ = function() { var source = this.getSource(); if (source) { this.sourceChangeKey_ = ol.events.listen(source, - ol.events.EventType.CHANGE, this.handleSourceChange_, false, this); + ol.events.EventType.CHANGE, this.handleSourceChange_, this); } this.changed(); }; @@ -179,9 +179,9 @@ ol.layer.Layer.prototype.setMap = function(map) { layerState.zIndex = Infinity; evt.frameState.layerStatesArray.push(layerState); evt.frameState.layerStates[goog.getUid(this)] = layerState; - }, false, this); + }, this); this.mapRenderKey_ = ol.events.listen( - this, ol.events.EventType.CHANGE, map.render, false, map); + this, ol.events.EventType.CHANGE, map.render, map); this.changed(); } }; diff --git a/src/ol/layer/layergroup.js b/src/ol/layer/layergroup.js index f0428f2598..291ee58e7c 100644 --- a/src/ol/layer/layergroup.js +++ b/src/ol/layer/layergroup.js @@ -58,7 +58,7 @@ ol.layer.Group = function(opt_options) { ol.events.listen(this, ol.Object.getChangeEventType(ol.layer.GroupProperty.LAYERS), - this.handleLayersChanged_, false, this); + this.handleLayersChanged_, this); if (layers) { if (goog.isArray(layers)) { @@ -99,9 +99,9 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) { var layers = this.getLayers(); this.layersListenerKeys_.push( ol.events.listen(layers, ol.CollectionEventType.ADD, - this.handleLayersAdd_, false, this), + this.handleLayersAdd_, this), ol.events.listen(layers, ol.CollectionEventType.REMOVE, - this.handleLayersRemove_, false, this)); + this.handleLayersRemove_, this)); goog.object.forEach(this.listenerKeys_, function(keys) { keys.forEach(ol.events.unlistenByKey); @@ -114,9 +114,9 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) { layer = layersArray[i]; this.listenerKeys_[goog.getUid(layer).toString()] = [ ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE, - this.handleLayerChange_, false, this), + this.handleLayerChange_, this), ol.events.listen(layer, ol.events.EventType.CHANGE, - this.handleLayerChange_, false, this) + this.handleLayerChange_, this) ]; } @@ -135,9 +135,9 @@ ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) { 'listeners already registered'); this.listenerKeys_[key] = [ ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE, - this.handleLayerChange_, false, this), + this.handleLayerChange_, this), ol.events.listen(layer, ol.events.EventType.CHANGE, - this.handleLayerChange_, false, this) + this.handleLayerChange_, this) ]; this.changed(); }; diff --git a/src/ol/map.js b/src/ol/map.js index 70f3886338..6b8bbb470f 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -298,7 +298,7 @@ ol.Map = function(options) { var mapBrowserEventHandler = new ol.MapBrowserEventHandler(this); ol.events.listen(mapBrowserEventHandler, goog.object.getValues(ol.MapBrowserEvent.EventType), - this.handleMapBrowserEvent, false, this); + this.handleMapBrowserEvent, this); this.registerDisposable(mapBrowserEventHandler); /** @@ -314,9 +314,9 @@ ol.Map = function(options) { this.keyHandlerKey_; ol.events.listen(this.viewport_, ol.events.EventType.WHEEL, - this.handleBrowserEvent, false, this); + this.handleBrowserEvent, this); ol.events.listen(this.viewport_, ol.events.EventType.MOUSEWHEEL, - this.handleBrowserEvent, false, this); + this.handleBrowserEvent, this); /** * @type {ol.Collection.