Add ol.Extent.getCenter

This commit is contained in:
Tom Payne
2012-07-14 15:29:36 +02:00
parent d5e706d9ff
commit 7107b8d105

View File

@@ -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.