Fix some stupid bugs in ol.TileBounds

This commit is contained in:
Tom Payne
2012-07-22 12:18:56 +02:00
parent 8987dc8607
commit ea623b7be6
3 changed files with 40 additions and 14 deletions
+12 -2
View File
@@ -49,13 +49,23 @@ ol.TileBounds.prototype.clone = function() {
};
/**
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @return {boolean} Contains tile coordinate.
*/
ol.TileBounds.prototype.contains = function(tileCoord) {
return this.minX <= tileCoord.x && tileCoord.x <= this.maxX &&
this.minY <= tileCoord.y && tileCoord.y <= this.maxY;
};
/**
* @param {ol.TileBounds} tileBounds Tile bounds.
* @return {boolean} Contains.
*/
ol.TileBounds.prototype.contains = function(tileBounds) {
ol.TileBounds.prototype.containsTileBounds = function(tileBounds) {
return this.minX <= tileBounds.minX && tileBounds.maxX <= this.maxX &&
this.minY <= tileBounds.minY && tileBounds.minY <= this.minY;
this.minY <= tileBounds.minY && tileBounds.minY <= this.maxY;
};