diff --git a/src/ol/extent.js b/src/ol/extent.js index d6f971483b..675122050d 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -29,6 +29,15 @@ ol.Extent.prototype.clone = function() { }; +/** + * @return {goog.math.Coordinate} Center. + */ +ol.Extent.prototype.getCenter = function() { + return new goog.math.Coordinate( + (this.left + this.right) / 2, (this.top + this.bottom) / 2); +}; + + /** * @param {ol.TransformFunction} transform Transform. * @return {ol.Extent} Extent.