Add ol.TileRange#containsXY function
This commit is contained in:
+11
-2
@@ -89,8 +89,7 @@ ol.TileRange.createOrUpdate = function(minX, maxX, minY, maxY, tileRange) {
|
||||
* @return {boolean} Contains tile coordinate.
|
||||
*/
|
||||
ol.TileRange.prototype.contains = function(tileCoord) {
|
||||
return this.minX <= tileCoord.x && tileCoord.x <= this.maxX &&
|
||||
this.minY <= tileCoord.y && tileCoord.y <= this.maxY;
|
||||
return this.containsXY(tileCoord.x, tileCoord.y);
|
||||
};
|
||||
|
||||
|
||||
@@ -104,6 +103,16 @@ ol.TileRange.prototype.containsTileRange = function(tileRange) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @return {boolean} Contains coordinate.
|
||||
*/
|
||||
ol.TileRange.prototype.containsXY = function(x, y) {
|
||||
return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.TileRange} tileRange Tile range.
|
||||
* @return {boolean} Equals.
|
||||
|
||||
Reference in New Issue
Block a user