diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index fffb4399c0..b669dee7d6 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -88,14 +88,14 @@ ol.geom.Circle.prototype.getCenter = function() { * @inheritDoc */ ol.geom.Circle.prototype.getExtent = function(opt_extent) { - if (this.extentRevision != this.revision) { + if (this.extentRevision != this.getRevision()) { var flatCoordinates = this.flatCoordinates; var radius = flatCoordinates[this.stride] - flatCoordinates[0]; this.extent = ol.extent.createOrUpdate( flatCoordinates[0] - radius, flatCoordinates[1] - radius, flatCoordinates[0] + radius, flatCoordinates[1] + radius, this.extent); - this.extentRevision = this.revision; + this.extentRevision = this.getRevision(); } goog.asserts.assert(goog.isDef(this.extent)); return ol.extent.returnOrUpdate(this.extent, opt_extent); diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index 7a41e08503..1907b580bc 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -2,7 +2,6 @@ goog.provide('ol.geom.Geometry'); goog.provide('ol.geom.GeometryType'); goog.require('goog.asserts'); -goog.require('goog.events.EventType'); goog.require('goog.functions'); goog.require('ol.Observable'); @@ -43,12 +42,6 @@ ol.geom.Geometry = function() { goog.base(this); - /** - * @protected - * @type {number} - */ - this.revision = 0; - /** * @protected * @type {ol.Extent|undefined} @@ -129,15 +122,6 @@ ol.geom.Geometry.prototype.containsCoordinate = function(coordinate) { ol.geom.Geometry.prototype.containsXY = goog.functions.FALSE; -/** - * FIXME empty description for jsdoc - */ -ol.geom.Geometry.prototype.dispatchChangeEvent = function() { - ++this.revision; - this.dispatchEvent(goog.events.EventType.CHANGE); -}; - - /** * @param {ol.Extent=} opt_extent Extent. * @return {ol.Extent} extent Extent. @@ -145,14 +129,6 @@ ol.geom.Geometry.prototype.dispatchChangeEvent = function() { ol.geom.Geometry.prototype.getExtent = goog.abstractMethod; -/** - * @return {number} Revision. - */ -ol.geom.Geometry.prototype.getRevision = function() { - return this.revision; -}; - - /** * @param {number} squaredTolerance Squared tolerance. * @return {ol.geom.Geometry} Simplified geometry. diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index e37e0dd04d..1c4f3cbfe2 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -91,7 +91,7 @@ ol.geom.GeometryCollection.prototype.containsXY = function(x, y) { * @inheritDoc */ ol.geom.GeometryCollection.prototype.getExtent = function(opt_extent) { - if (this.extentRevision != this.revision) { + if (this.extentRevision != this.getRevision()) { var extent = ol.extent.createOrUpdateEmpty(this.extent); var geometries = this.geometries_; var i, ii; @@ -99,7 +99,7 @@ ol.geom.GeometryCollection.prototype.getExtent = function(opt_extent) { ol.extent.extend(extent, geometries[i].getExtent()); } this.extent = extent; - this.extentRevision = this.revision; + this.extentRevision = this.getRevision(); } goog.asserts.assert(goog.isDef(this.extent)); return ol.extent.returnOrUpdate(this.extent, opt_extent); @@ -127,10 +127,10 @@ ol.geom.GeometryCollection.prototype.getGeometriesArray = function() { */ ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTolerance) { - if (this.simplifiedGeometryRevision != this.revision) { + if (this.simplifiedGeometryRevision != this.getRevision()) { goog.object.clear(this.simplifiedGeometryCache); this.simplifiedGeometryMaxMinSquaredTolerance = 0; - this.simplifiedGeometryRevision = this.revision; + this.simplifiedGeometryRevision = this.getRevision(); } if (squaredTolerance < 0 || (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index 1772b5f0ab..c74a20bb59 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -56,10 +56,10 @@ ol.geom.LinearRing.prototype.closestPointXY = ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; } - if (this.maxDeltaRevision_ != this.revision) { + if (this.maxDeltaRevision_ != this.getRevision()) { this.maxDelta_ = Math.sqrt(ol.geom.closest.getMaxSquaredDelta( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)); - this.maxDeltaRevision_ = this.revision; + this.maxDeltaRevision_ = this.getRevision(); } return ol.geom.closest.getClosestPoint( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index acc3ac8053..3f94e05a72 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -56,10 +56,10 @@ ol.geom.LineString.prototype.closestPointXY = ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; } - if (this.maxDeltaRevision_ != this.revision) { + if (this.maxDeltaRevision_ != this.getRevision()) { this.maxDelta_ = Math.sqrt(ol.geom.closest.getMaxSquaredDelta( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)); - this.maxDeltaRevision_ = this.revision; + this.maxDeltaRevision_ = this.getRevision(); } return ol.geom.closest.getClosestPoint( this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js index c649e41a52..76256ca336 100644 --- a/src/ol/geom/multilinestring.js +++ b/src/ol/geom/multilinestring.js @@ -66,10 +66,10 @@ ol.geom.MultiLineString.prototype.closestPointXY = ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; } - if (this.maxDeltaRevision_ != this.revision) { + if (this.maxDeltaRevision_ != this.getRevision()) { this.maxDelta_ = Math.sqrt(ol.geom.closest.getsMaxSquaredDelta( this.flatCoordinates, 0, this.ends_, this.stride, 0)); - this.maxDeltaRevision_ = this.revision; + this.maxDeltaRevision_ = this.getRevision(); } return ol.geom.closest.getsClosestPoint( this.flatCoordinates, 0, this.ends_, this.stride, diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index 27727e70a4..2f3e25966f 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -76,10 +76,10 @@ ol.geom.MultiPolygon.prototype.closestPointXY = ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; } - if (this.maxDeltaRevision_ != this.revision) { + if (this.maxDeltaRevision_ != this.getRevision()) { this.maxDelta_ = Math.sqrt(ol.geom.closest.getssMaxSquaredDelta( this.flatCoordinates, 0, this.endss_, this.stride, 0)); - this.maxDeltaRevision_ = this.revision; + this.maxDeltaRevision_ = this.getRevision(); } return ol.geom.closest.getssClosestPoint( this.flatCoordinates, 0, this.endss_, this.stride, @@ -126,12 +126,12 @@ ol.geom.MultiPolygon.prototype.getEndss = function() { * @return {Array.