Add geom.ol.geom.Geometry#computeExtent function

This commit is contained in:
Frederic Junod
2015-01-08 11:38:20 +01:00
parent 35468e2bbb
commit 8bd0a1232a
5 changed files with 37 additions and 50 deletions

View File

@@ -90,17 +90,11 @@ ol.geom.SimpleGeometry.prototype.containsXY = goog.functions.FALSE;
/**
* @inheritDoc
* @api stable
*/
ol.geom.SimpleGeometry.prototype.getExtent = function(opt_extent) {
if (this.extentRevision != this.getRevision()) {
this.extent = ol.extent.createOrUpdateFromFlatCoordinates(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
this.extent);
this.extentRevision = this.getRevision();
}
goog.asserts.assert(goog.isDef(this.extent));
return ol.extent.returnOrUpdate(this.extent, opt_extent);
ol.geom.SimpleGeometry.prototype.computeExtent = function(extent) {
return ol.extent.createOrUpdateFromFlatCoordinates(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
extent);
};