From 5186fa44f589dbc19a0d45c52dde87a58958d8cf Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 19 Mar 2013 17:21:15 +0100 Subject: [PATCH] Add ol.Rectangle.isEmpty --- src/ol/rectangle.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ol/rectangle.js b/src/ol/rectangle.js index 3fc8cfbbc2..70a4add53e 100644 --- a/src/ol/rectangle.js +++ b/src/ol/rectangle.js @@ -104,6 +104,14 @@ ol.Rectangle.prototype.intersects = function(rectangle) { }; +/** + * @return {boolean} Is empty. + */ +ol.Rectangle.prototype.isEmpty = function() { + return this.maxX < this.minX || this.maxY < this.minY; +}; + + /** * @param {ol.Coordinate} coordinate Coordinate. * @return {ol.Coordinate} Coordinate.