Add geom.ol.geom.Geometry#computeExtent function
This commit is contained in:
@@ -94,20 +94,14 @@ ol.geom.Circle.prototype.getCenter = function() {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
ol.geom.Circle.prototype.getExtent = function(opt_extent) {
|
||||
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.getRevision();
|
||||
}
|
||||
goog.asserts.assert(goog.isDef(this.extent));
|
||||
return ol.extent.returnOrUpdate(this.extent, opt_extent);
|
||||
ol.geom.Circle.prototype.computeExtent = function(extent) {
|
||||
var flatCoordinates = this.flatCoordinates;
|
||||
var radius = flatCoordinates[this.stride] - flatCoordinates[0];
|
||||
return ol.extent.createOrUpdate(
|
||||
flatCoordinates[0] - radius, flatCoordinates[1] - radius,
|
||||
flatCoordinates[0] + radius, flatCoordinates[1] + radius,
|
||||
extent);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user