From 860b4407b7a0fa627a9a9d3d5be9c7216ea3588b Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 18 Oct 2012 13:49:10 +0200 Subject: [PATCH] Add ol.Extent.get{Bottom,Top}{Left,Right} --- src/ol/extent.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/ol/extent.js b/src/ol/extent.js index b8812eb1f3..7d7c2d7f60 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -50,6 +50,38 @@ ol.Extent.prototype.contains = function(coordinate) { }; +/** + * @return {ol.Coordinate} Bottom left coordinate. + */ +ol.Extent.prototype.getBottomLeft = function() { + return new ol.Coordinate(this.minX, this.minY); +}; + + +/** + * @return {ol.Coordinate} Bottom right coordinate. + */ +ol.Extent.prototype.getBottomRight = function() { + return new ol.Coordinate(this.maxX, this.minY); +}; + + +/** + * @return {ol.Coordinate} Top left coordinate. + */ +ol.Extent.prototype.getTopLeft = function() { + return new ol.Coordinate(this.minX, this.maxY); +}; + + +/** + * @return {ol.Coordinate} Top right coordinate. + */ +ol.Extent.prototype.getTopRight = function() { + return new ol.Coordinate(this.maxX, this.maxY); +}; + + /** * @param {ol.TransformFunction} transformFn Transform function. * @return {ol.Extent} Extent.