From f46c9e12fb5c5983de1fb13a6061ff0a293725c3 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 22 Jul 2012 01:13:26 +0200 Subject: [PATCH] Add ol.TileBounds.containsTileBounds --- src/ol/tilebounds.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ol/tilebounds.js b/src/ol/tilebounds.js index 57347567b0..ace41a050a 100644 --- a/src/ol/tilebounds.js +++ b/src/ol/tilebounds.js @@ -49,6 +49,16 @@ ol.TileBounds.prototype.clone = function() { }; +/** + * @param {ol.TileBounds} tileBounds Tile bounds. + * @return {boolean} Contains. + */ +ol.TileBounds.prototype.contains = function(tileBounds) { + return this.minX <= tileBounds.minX && tileBounds.maxX <= this.maxX && + this.minY <= tileBounds.minY && tileBounds.minY <= this.minY; +}; + + /** * @param {number} z Z. * @param {function(this: T, ol.TileCoord)} f Callback.