Use inherited dispatchChangeEvent and getRevision in ol.geom.Geometry

This commit is contained in:
Tom Payne
2014-01-21 11:43:08 +01:00
parent 911cb302e8
commit edcb38232f
10 changed files with 26 additions and 50 deletions

View File

@@ -76,10 +76,10 @@ ol.geom.Polygon.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,
@@ -126,12 +126,12 @@ ol.geom.Polygon.prototype.getEnds = function() {
* @return {ol.Coordinate} Interior point.
*/
ol.geom.Polygon.prototype.getInteriorPoint = function() {
if (this.interiorPointRevision_ != this.revision) {
if (this.interiorPointRevision_ != this.getRevision()) {
var extent = this.getExtent();
var y = (extent[1] + extent[3]) / 2;
this.interiorPoint_ = ol.geom.flat.linearRingsGetInteriorPoint(
this.flatCoordinates, 0, this.ends_, this.stride, y);
this.interiorPointRevision_ = this.revision;
this.interiorPointRevision_ = this.getRevision();
}
return this.interiorPoint_;
};