From ebe3b48e0aeb524c5312ec843712c4edf36d8c05 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 4 Sep 2014 19:30:48 -0600 Subject: [PATCH] Rename ol.Observable#dispatchChangeEvent() to #changed() Since dispatchChangeEvent does not only dispatch a change event, but also increases the revision counter, the method name should reflect this. --- examples/geolocation-orientation.js | 2 +- src/ol/deviceorientation.js | 2 +- src/ol/feature.js | 8 ++++---- src/ol/geolocation.js | 2 +- src/ol/geom/circle.js | 6 +++--- src/ol/geom/geometrycollection.js | 8 ++++---- src/ol/geom/linearring.js | 4 ++-- src/ol/geom/linestring.js | 6 +++--- src/ol/geom/multilinestring.js | 6 +++--- src/ol/geom/multipoint.js | 6 +++--- src/ol/geom/multipolygon.js | 6 +++--- src/ol/geom/point.js | 4 ++-- src/ol/geom/polygon.js | 6 +++--- src/ol/geom/simplegeometry.js | 2 +- src/ol/image.js | 4 ++-- src/ol/imagebase.js | 2 +- src/ol/imagetile.js | 4 ++-- src/ol/layer/layer.js | 2 +- src/ol/layer/layergroup.js | 8 ++++---- src/ol/layer/vectorlayer.js | 2 +- src/ol/observable.js | 6 +++--- src/ol/source/clustersource.js | 2 +- src/ol/source/imagemapguidesource.js | 2 +- src/ol/source/imagevectorsource.js | 2 +- src/ol/source/imagewmssource.js | 4 ++-- src/ol/source/source.js | 2 +- src/ol/source/tileimagesource.js | 4 ++-- src/ol/source/tilevectorsource.js | 2 +- src/ol/source/tilewmssource.js | 4 ++-- src/ol/source/vectorsource.js | 10 +++++----- src/ol/source/wmtssource.js | 2 +- src/ol/tile.js | 2 +- 32 files changed, 66 insertions(+), 66 deletions(-) diff --git a/examples/geolocation-orientation.js b/examples/geolocation-orientation.js index 2a3a32aa05..a468dc98d7 100644 --- a/examples/geolocation-orientation.js +++ b/examples/geolocation-orientation.js @@ -220,7 +220,7 @@ function simulatePositionChange(position) { 'EPSG:3857'); geolocation.set('position', projectedPosition); geolocation.set('speed', coords.speed); - geolocation.dispatchChangeEvent(); + geolocation.changed(); } function disableButtons() { diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index 9b721246b7..a8b9ddf3d5 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -132,7 +132,7 @@ ol.DeviceOrientation.prototype.orientationChange_ = function(browserEvent) { this.set(ol.DeviceOrientationProperty.GAMMA, goog.math.toRadians(event.gamma)); } - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/feature.js b/src/ol/feature.js index 2a08a89bfc..5d392bbe84 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -198,7 +198,7 @@ ol.Feature.prototype.getStyleFunction = function() { * @private */ ol.Feature.prototype.handleGeometryChange_ = function() { - this.dispatchChangeEvent(); + this.changed(); }; @@ -214,7 +214,7 @@ ol.Feature.prototype.handleGeometryChanged_ = function() { if (goog.isDefAndNotNull(geometry)) { this.geometryChangeKey_ = goog.events.listen(geometry, goog.events.EventType.CHANGE, this.handleGeometryChange_, false, this); - this.dispatchChangeEvent(); + this.changed(); } }; @@ -244,7 +244,7 @@ goog.exportProperty( ol.Feature.prototype.setStyle = function(style) { this.style_ = style; this.styleFunction_ = ol.feature.createFeatureStyleFunction(style); - this.dispatchChangeEvent(); + this.changed(); }; @@ -256,7 +256,7 @@ ol.Feature.prototype.setStyle = function(style) { */ ol.Feature.prototype.setId = function(id) { this.id_ = id; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index f9c1f87c26..d5cf49ac84 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -173,7 +173,7 @@ ol.Geolocation.prototype.positionChange_ = function(position) { ol.sphere.WGS84, this.position_, coords.accuracy); geometry.applyTransform(this.transform_); this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index 959f7b8bec..9ad111985e 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -182,7 +182,7 @@ ol.geom.Circle.prototype.setCenterAndRadius = flatCoordinates[offset++] = flatCoordinates[i]; } flatCoordinates.length = offset; - this.dispatchChangeEvent(); + this.changed(); } }; @@ -194,7 +194,7 @@ ol.geom.Circle.prototype.setCenterAndRadius = ol.geom.Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); - this.dispatchChangeEvent(); + this.changed(); }; @@ -205,7 +205,7 @@ ol.geom.Circle.prototype.setFlatCoordinates = ol.geom.Circle.prototype.setRadius = function(radius) { goog.asserts.assert(!goog.isNull(this.flatCoordinates)); this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index 13258a913d..ace6adfdf8 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -61,7 +61,7 @@ ol.geom.GeometryCollection.prototype.unlistenGeometriesChange_ = function() { for (i = 0, ii = this.geometries_.length; i < ii; ++i) { goog.events.unlisten( this.geometries_[i], goog.events.EventType.CHANGE, - this.dispatchChangeEvent, false, this); + this.changed, false, this); } }; @@ -77,7 +77,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() { for (i = 0, ii = this.geometries_.length; i < ii; ++i) { goog.events.listen( this.geometries_[i], goog.events.EventType.CHANGE, - this.dispatchChangeEvent, false, this); + this.changed, false, this); } }; @@ -243,7 +243,7 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) { this.unlistenGeometriesChange_(); this.geometries_ = geometries; this.listenGeometriesChange_(); - this.dispatchChangeEvent(); + this.changed(); }; @@ -256,7 +256,7 @@ ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) { for (i = 0, ii = geometries.length; i < ii; ++i) { geometries[i].applyTransform(transformFn); } - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index 11d8a3bb1b..f527d13944 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -138,7 +138,7 @@ ol.geom.LinearRing.prototype.setCoordinates = } this.flatCoordinates.length = ol.geom.flat.deflate.coordinates( this.flatCoordinates, 0, coordinates, this.stride); - this.dispatchChangeEvent(); + this.changed(); } }; @@ -150,5 +150,5 @@ ol.geom.LinearRing.prototype.setCoordinates = ol.geom.LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index d03ece4d33..a7027e4b72 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -70,7 +70,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) { } else { ol.array.safeExtend(this.flatCoordinates, coordinate); } - this.dispatchChangeEvent(); + this.changed(); }; @@ -206,7 +206,7 @@ ol.geom.LineString.prototype.setCoordinates = } this.flatCoordinates.length = ol.geom.flat.deflate.coordinates( this.flatCoordinates, 0, coordinates, this.stride); - this.dispatchChangeEvent(); + this.changed(); } }; @@ -218,5 +218,5 @@ ol.geom.LineString.prototype.setCoordinates = ol.geom.LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js index 20fb841c1f..a2b2e3dc3c 100644 --- a/src/ol/geom/multilinestring.js +++ b/src/ol/geom/multilinestring.js @@ -66,7 +66,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) { this.flatCoordinates, lineString.getFlatCoordinates().slice()); } this.ends_.push(this.flatCoordinates.length); - this.dispatchChangeEvent(); + this.changed(); }; @@ -261,7 +261,7 @@ ol.geom.MultiLineString.prototype.setCoordinates = var ends = ol.geom.flat.deflate.coordinatess( this.flatCoordinates, 0, coordinates, this.stride, this.ends_); this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1]; - this.dispatchChangeEvent(); + this.changed(); } }; @@ -282,7 +282,7 @@ ol.geom.MultiLineString.prototype.setFlatCoordinates = } this.setFlatCoordinatesInternal(layout, flatCoordinates); this.ends_ = ends; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/multipoint.js b/src/ol/geom/multipoint.js index 10322338e1..b1b414ffbd 100644 --- a/src/ol/geom/multipoint.js +++ b/src/ol/geom/multipoint.js @@ -41,7 +41,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) { } else { ol.array.safeExtend(this.flatCoordinates, point.getFlatCoordinates()); } - this.dispatchChangeEvent(); + this.changed(); }; @@ -158,7 +158,7 @@ ol.geom.MultiPoint.prototype.setCoordinates = } this.flatCoordinates.length = ol.geom.flat.deflate.coordinates( this.flatCoordinates, 0, coordinates, this.stride); - this.dispatchChangeEvent(); + this.changed(); } }; @@ -170,5 +170,5 @@ ol.geom.MultiPoint.prototype.setCoordinates = ol.geom.MultiPoint.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index 71d873465a..e546877f65 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -104,7 +104,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) { } } this.endss_.push(ends); - this.dispatchChangeEvent(); + this.changed(); }; @@ -338,7 +338,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates = this.flatCoordinates.length = lastEnds.length === 0 ? 0 : lastEnds[lastEnds.length - 1]; } - this.dispatchChangeEvent(); + this.changed(); } }; @@ -360,7 +360,7 @@ ol.geom.MultiPolygon.prototype.setFlatCoordinates = } this.setFlatCoordinatesInternal(layout, flatCoordinates); this.endss_ = endss; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index 54c3ac6f32..d030d7a8aa 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -108,7 +108,7 @@ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) { } this.flatCoordinates.length = ol.geom.flat.deflate.coordinate( this.flatCoordinates, 0, coordinates, this.stride); - this.dispatchChangeEvent(); + this.changed(); } }; @@ -119,5 +119,5 @@ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) { */ ol.geom.Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index ffc37267ef..7e91e80ba5 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -94,7 +94,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) { ol.array.safeExtend(this.flatCoordinates, linearRing.getFlatCoordinates()); } this.ends_.push(this.flatCoordinates.length); - this.dispatchChangeEvent(); + this.changed(); }; @@ -312,7 +312,7 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) { var ends = ol.geom.flat.deflate.coordinatess( this.flatCoordinates, 0, coordinates, this.stride, this.ends_); this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1]; - this.dispatchChangeEvent(); + this.changed(); } }; @@ -333,7 +333,7 @@ ol.geom.Polygon.prototype.setFlatCoordinates = } this.setFlatCoordinatesInternal(layout, flatCoordinates); this.ends_ = ends; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index a38177f9d2..847cd292fb 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -249,7 +249,7 @@ ol.geom.SimpleGeometry.prototype.setLayout = ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) { if (!goog.isNull(this.flatCoordinates)) { transformFn(this.flatCoordinates, this.flatCoordinates, this.stride); - this.dispatchChangeEvent(); + this.changed(); } }; diff --git a/src/ol/image.js b/src/ol/image.js index 963e4bdff8..0b7c3bc63d 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -93,7 +93,7 @@ ol.Image.prototype.getImageElement = function(opt_context) { ol.Image.prototype.handleImageError_ = function() { this.state = ol.ImageState.ERROR; this.unlistenImage_(); - this.dispatchChangeEvent(); + this.changed(); }; @@ -105,7 +105,7 @@ ol.Image.prototype.handleImageError_ = function() { ol.Image.prototype.handleImageLoad_ = function() { this.state = ol.ImageState.LOADED; this.unlistenImage_(); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/imagebase.js b/src/ol/imagebase.js index 8924be9a5f..ff6d2b4c06 100644 --- a/src/ol/imagebase.js +++ b/src/ol/imagebase.js @@ -69,7 +69,7 @@ goog.inherits(ol.ImageBase, goog.events.EventTarget); /** * @protected */ -ol.ImageBase.prototype.dispatchChangeEvent = function() { +ol.ImageBase.prototype.changed = function() { this.dispatchEvent(goog.events.EventType.CHANGE); }; diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index 57e85abd36..7765b138c5 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -103,7 +103,7 @@ ol.ImageTile.prototype.getKey = function() { ol.ImageTile.prototype.handleImageError_ = function() { this.state = ol.TileState.ERROR; this.unlistenImage_(); - this.dispatchChangeEvent(); + this.changed(); }; @@ -124,7 +124,7 @@ ol.ImageTile.prototype.handleImageLoad_ = function() { this.state = ol.TileState.EMPTY; } this.unlistenImage_(); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/layer/layer.js b/src/ol/layer/layer.js index bcea83ac7d..ac9d992406 100644 --- a/src/ol/layer/layer.js +++ b/src/ol/layer/layer.js @@ -99,5 +99,5 @@ ol.layer.Layer.prototype.getSourceState = function() { * @private */ ol.layer.Layer.prototype.handleSourceChange_ = function() { - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/layer/layergroup.js b/src/ol/layer/layergroup.js index c685a6ec2c..fb4e5e38be 100644 --- a/src/ol/layer/layergroup.js +++ b/src/ol/layer/layergroup.js @@ -78,7 +78,7 @@ goog.inherits(ol.layer.Group, ol.layer.Base); */ ol.layer.Group.prototype.handleLayerChange_ = function() { if (this.getVisible()) { - this.dispatchChangeEvent(); + this.changed(); } }; @@ -114,7 +114,7 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) { } } - this.dispatchChangeEvent(); + this.changed(); }; @@ -127,7 +127,7 @@ ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) { this.listenerKeys_[goog.getUid(layer).toString()] = goog.events.listen( layer, [ol.ObjectEventType.PROPERTYCHANGE, goog.events.EventType.CHANGE], this.handleLayerChange_, false, this); - this.dispatchChangeEvent(); + this.changed(); }; @@ -140,7 +140,7 @@ ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) { var key = goog.getUid(layer).toString(); goog.events.unlistenByKey(this.listenerKeys_[key]); delete this.listenerKeys_[key]; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/layer/vectorlayer.js b/src/ol/layer/vectorlayer.js index 2a8f5ff163..2acd21415a 100644 --- a/src/ol/layer/vectorlayer.js +++ b/src/ol/layer/vectorlayer.js @@ -121,5 +121,5 @@ ol.layer.Vector.prototype.setStyle = function(style) { this.style_ = goog.isDef(style) ? style : ol.style.defaultStyleFunction; this.styleFunction_ = goog.isNull(style) ? undefined : ol.style.createStyleFunction(this.style_); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/observable.js b/src/ol/observable.js index 8fa80d5687..e7a304a28b 100644 --- a/src/ol/observable.js +++ b/src/ol/observable.js @@ -12,7 +12,7 @@ goog.require('goog.events.EventType'); * instantiated in apps. * An event target providing convenient methods for listener registration * and unregistration. A generic `change` event is always available through - * {@link ol.Observable#dispatchChangeEvent}. + * {@link ol.Observable#changed}. * * @constructor * @extends {goog.events.EventTarget} @@ -35,11 +35,11 @@ goog.inherits(ol.Observable, goog.events.EventTarget); /** - * Dispatches a `change` event. + * Increases the revision counter and disptches a 'change' event. * @fires change * @api */ -ol.Observable.prototype.dispatchChangeEvent = function() { +ol.Observable.prototype.changed = function() { ++this.revision_; this.dispatchEvent(goog.events.EventType.CHANGE); }; diff --git a/src/ol/source/clustersource.js b/src/ol/source/clustersource.js index 888298e444..a9a83b9847 100644 --- a/src/ol/source/clustersource.js +++ b/src/ol/source/clustersource.js @@ -81,7 +81,7 @@ ol.source.Cluster.prototype.onSourceChange_ = function() { this.clear(); this.cluster_(); this.addFeatures(this.features_); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/imagemapguidesource.js b/src/ol/source/imagemapguidesource.js index 7416254805..27c7adac6a 100644 --- a/src/ol/source/imagemapguidesource.js +++ b/src/ol/source/imagemapguidesource.js @@ -179,7 +179,7 @@ ol.source.ImageMapGuide.getScale = function(extent, size, metersPerUnit, dpi) { */ ol.source.ImageMapGuide.prototype.updateParams = function(params) { goog.object.extend(this.params_, params); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/imagevectorsource.js b/src/ol/source/imagevectorsource.js index 59c366133f..adfa47310c 100644 --- a/src/ol/source/imagevectorsource.js +++ b/src/ol/source/imagevectorsource.js @@ -204,7 +204,7 @@ ol.source.ImageVector.prototype.getTransform_ = */ ol.source.ImageVector.prototype.handleImageChange_ = function(event) { - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/imagewmssource.js b/src/ol/source/imagewmssource.js index 916c5e3189..05c162a141 100644 --- a/src/ol/source/imagewmssource.js +++ b/src/ol/source/imagewmssource.js @@ -319,7 +319,7 @@ ol.source.ImageWMS.prototype.setUrl = function(url) { if (url != this.url_) { this.url_ = url; this.image_ = null; - this.dispatchChangeEvent(); + this.changed(); } }; @@ -333,7 +333,7 @@ ol.source.ImageWMS.prototype.updateParams = function(params) { goog.object.extend(this.params_, params); this.updateV13_(); this.image_ = null; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/source.js b/src/ol/source/source.js index 81797803fa..cd4e1baa2a 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -153,7 +153,7 @@ ol.source.Source.prototype.setLogo = function(logo) { */ ol.source.Source.prototype.setState = function(state) { this.state_ = state; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/tileimagesource.js b/src/ol/source/tileimagesource.js index 94b00ed777..600eb69313 100644 --- a/src/ol/source/tileimagesource.js +++ b/src/ol/source/tileimagesource.js @@ -149,7 +149,7 @@ ol.source.TileImage.prototype.getTileUrlFunction = function() { ol.source.TileImage.prototype.setTileLoadFunction = function(tileLoadFunction) { this.tileCache.clear(); this.tileLoadFunction = tileLoadFunction; - this.dispatchChangeEvent(); + this.changed(); }; @@ -163,7 +163,7 @@ ol.source.TileImage.prototype.setTileUrlFunction = function(tileUrlFunction) { // FIXME cache key somehow. this.tileCache.clear(); this.tileUrlFunction = tileUrlFunction; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/tilevectorsource.js b/src/ol/source/tilevectorsource.js index 0a845574b0..1dc0ed79db 100644 --- a/src/ol/source/tilevectorsource.js +++ b/src/ol/source/tilevectorsource.js @@ -223,7 +223,7 @@ ol.source.TileVector.prototype.removeFeature = goog.abstractMethod; */ ol.source.TileVector.prototype.setTileUrlFunction = function(tileUrlFunction) { this.tileUrlFunction_ = tileUrlFunction; - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index 742ad31290..fd227e9a6d 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -341,7 +341,7 @@ ol.source.TileWMS.prototype.setUrl = function(url) { ol.source.TileWMS.prototype.setUrls = function(urls) { this.urls_ = goog.isDefAndNotNull(urls) ? urls : []; this.resetCoordKeyPrefix_(); - this.dispatchChangeEvent(); + this.changed(); }; @@ -407,7 +407,7 @@ ol.source.TileWMS.prototype.updateParams = function(params) { goog.object.extend(this.params_, params); this.resetCoordKeyPrefix_(); this.updateV13_(); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index aa2723274a..e82ade9da9 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -106,7 +106,7 @@ goog.inherits(ol.source.Vector, ol.source.Source); */ ol.source.Vector.prototype.addFeature = function(feature) { this.addFeatureInternal(feature); - this.dispatchChangeEvent(); + this.changed(); }; @@ -152,7 +152,7 @@ ol.source.Vector.prototype.addFeatureInternal = function(feature) { */ ol.source.Vector.prototype.addFeatures = function(features) { this.addFeaturesInternal(features); - this.dispatchChangeEvent(); + this.changed(); }; @@ -181,7 +181,7 @@ ol.source.Vector.prototype.clear = function() { this.nullGeometryFeatures_, this.removeFeatureInternal, this); goog.object.clear(this.nullGeometryFeatures_); goog.asserts.assert(goog.object.isEmpty(this.featureChangeKeys_)); - this.dispatchChangeEvent(); + this.changed(); }; @@ -403,7 +403,7 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) { goog.asserts.assert(this.undefIdIndex_[featureKey] === feature); } } - this.dispatchChangeEvent(); + this.changed(); }; @@ -436,7 +436,7 @@ ol.source.Vector.prototype.removeFeature = function(feature) { this.rBush_.remove(feature); } this.removeFeatureInternal(feature); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index a9a566597e..4b66dfd216 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -232,7 +232,7 @@ ol.source.WMTS.prototype.resetCoordKeyPrefix_ = function() { ol.source.WMTS.prototype.updateDimensions = function(dimensions) { goog.object.extend(this.dimensions_, dimensions); this.resetCoordKeyPrefix_(); - this.dispatchChangeEvent(); + this.changed(); }; diff --git a/src/ol/tile.js b/src/ol/tile.js index aa8dc28ccc..ddec563059 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -51,7 +51,7 @@ goog.inherits(ol.Tile, goog.events.EventTarget); /** * @protected */ -ol.Tile.prototype.dispatchChangeEvent = function() { +ol.Tile.prototype.changed = function() { this.dispatchEvent(goog.events.EventType.CHANGE); };