From 9fbadfa79f323bc727fac9d003c0dd7fe88d3a18 Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Thu, 8 Mar 2012 00:31:05 -0600 Subject: [PATCH 1/6] Modify initSingleTile to respect map or layer maxExtent when set and layer is not the map's baseLayer --- lib/OpenLayers/Layer/Grid.js | 52 +++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 67e47732a3..f23ccee3a2 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -718,18 +718,50 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { */ initSingleTile: function(bounds) { this.clearTileQueue(); - + //determine if a maxExtent restriction exists + var maxExt = this.maxExtent || this.map.getMaxExtent() || this.map.maxExtent; + //determine new tile bounds + var tileWidth, tileHeight, tileBounds; var center = bounds.getCenterLonLat(); - var tileWidth = bounds.getWidth() * this.ratio; - var tileHeight = bounds.getHeight() * this.ratio; - - var tileBounds = - new OpenLayers.Bounds(center.lon - (tileWidth/2), - center.lat - (tileHeight/2), - center.lon + (tileWidth/2), - center.lat + (tileHeight/2)); - + //adjust tile bounds to fit in maxExtent restriction + //if it is an overlay and there is a maxExtent restriction + if(this != this.map.baseLayer && maxExt && bounds.containsBounds(maxExt)) { + bounds.bottom = Math.max(maxExt.bottom, bounds.bottom); + bounds.top = Math.min(maxExt.top, bounds.top); + bounds.left = Math.max(maxExt.left, bounds.left); + bounds.right = Math.min(maxExt.right, bounds.right); + tileWidth = bounds.getWidth(); + tileHeight = bounds.getHeight(); + tileBounds = bounds; + var blPx = this.map.getLayerPxFromLonLat({ + lon : tileBounds.left, + lat : tileBounds.bottom + }); + var trPx = this.map.getLayerPxFromLonLat({ + lon : tileBounds.right, + lat : tileBounds.top + }); + this.tileSize = { + h : Math.abs(trPx.y - blPx.y), + w : Math.abs(trPx.x - blPx.x) + }; + this._resetTileSize = true; + } + else { + tileWidth = bounds.getWidth() * this.ratio; + tileHeight = bounds.getHeight() * this.ratio; + tileBounds = + new OpenLayers.Bounds( + center.lon - (tileWidth / 2), + center.lat - (tileHeight / 2), + center.lon + (tileWidth / 2), + center.lat + (tileHeight / 2) + ); + if(this._resetTileSize === true) { + this.setTileSize(); + } + } var px = this.map.getLayerPxFromLonLat({ lon: tileBounds.left, lat: tileBounds.top From 3fd1cecf04473ca540d2bf78dcfc24e535e5485a Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Thu, 8 Mar 2012 16:20:23 -0600 Subject: [PATCH 2/6] SingleTile WMS layers don't respect maxExtent values set on the layer --- lib/OpenLayers/Layer/Grid.js | 26 ++++++++++---------- tests/Layer/Grid.html | 46 +++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index f23ccee3a2..99d8814d52 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -718,19 +718,18 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { */ initSingleTile: function(bounds) { this.clearTileQueue(); - //determine if a maxExtent restriction exists - var maxExt = this.maxExtent || this.map.getMaxExtent() || this.map.maxExtent; - + //determine new tile bounds var tileWidth, tileHeight, tileBounds; var center = bounds.getCenterLonLat(); + //adjust tile bounds to fit in maxExtent restriction - //if it is an overlay and there is a maxExtent restriction - if(this != this.map.baseLayer && maxExt && bounds.containsBounds(maxExt)) { - bounds.bottom = Math.max(maxExt.bottom, bounds.bottom); - bounds.top = Math.min(maxExt.top, bounds.top); - bounds.left = Math.max(maxExt.left, bounds.left); - bounds.right = Math.min(maxExt.right, bounds.right); + //if there is a maxExtent restriction + if(this.maxExtent && bounds.containsBounds(this.maxExtent, true)) { + bounds.bottom = Math.max(this.maxExtent.bottom, bounds.bottom); + bounds.top = Math.min(this.maxExtent.top, bounds.top); + bounds.left = Math.max(this.maxExtent.left, bounds.left); + bounds.right = Math.min(this.maxExtent.right, bounds.right); tileWidth = bounds.getWidth(); tileHeight = bounds.getHeight(); tileBounds = bounds; @@ -742,10 +741,10 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { lon : tileBounds.right, lat : tileBounds.top }); - this.tileSize = { - h : Math.abs(trPx.y - blPx.y), - w : Math.abs(trPx.x - blPx.x) - }; + this.tileSize = new OpenLayers.Size( + Math.abs(trPx.x - blPx.x), + Math.abs(trPx.y - blPx.y) + ); this._resetTileSize = true; } else { @@ -760,6 +759,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { ); if(this._resetTileSize === true) { this.setTileSize(); + delete this._resetTileSize; } } var px = this.map.getLayerPxFromLonLat({ diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index 34abdea092..395d93c087 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -449,7 +449,7 @@ } function test_Layer_Grid_initSingleTile(t) { - t.plan( 11 ); + t.plan( 19 ); layer = new OpenLayers.Layer.Grid(name, url, params, { singleTile: true, @@ -501,8 +501,48 @@ } }; layer.grid = [[ tile ]]; - layer.initSingleTile(bounds); - + layer.initSingleTile(bounds); + + //test maxExtent restrictions + //reset grid + layer.grid = []; + //layer.buffer = 0; + //layer.ratio = 1; + //useful mocks + layer.map = { + getLayerPxFromLonLat: function(ul) { + return { + x:ul.lon, + y:ul.lat + }; + }, + getResolution:function(){return 1;} + }; + layer.addTile = function(tileBounds, px) { + t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to addTile to create new tile"); + t.ok(px.x == translatedPX.x && px.y == translatedPX.y, "correct tile px passed to addTile to create new tile"); + return newTile; + }; + tile = { + moveTo: function(tileBounds, px) { + t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to tile.moveTo()"); + t.ok(px.x == translatedPX.x && px.y == translatedPX.y, "correct tile px passed to tile.moveTo()"); + } + }; + //test bound fully contains the maxExtent + //tile bounds -10,10,50,100 + layer.maxExtent = new OpenLayers.Bounds(0,20,40,90); + desiredTileBounds = new OpenLayers.Bounds(0,20,40,90); + translatedPX = {x:0,y:90}; + layer.initSingleTile(bounds); + + //test bound overlaps the maxExtent + bounds = new OpenLayers.Bounds(-10,10,50,100); + layer.maxExtent = new OpenLayers.Bounds(-30,20,40,110); + desiredTileBounds = new OpenLayers.Bounds(-10,20,40,100); + translatedPX = {x:-10,y:100}; + layer.grid = [[ tile ]]; + layer.initSingleTile(bounds); } function test_Layer_Grid_addTileMonitoringHooks(t) { From 9d0dd67843446f400631b8b0c235a3dba4504378 Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Thu, 8 Mar 2012 16:20:23 -0600 Subject: [PATCH 3/6] Add tests for initSingleTile function, which is where all the important singleTile logic is --- lib/OpenLayers/Layer/Grid.js | 26 ++++++++++----------- tests/Layer/Grid.html | 44 +++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index f23ccee3a2..99d8814d52 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -718,19 +718,18 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { */ initSingleTile: function(bounds) { this.clearTileQueue(); - //determine if a maxExtent restriction exists - var maxExt = this.maxExtent || this.map.getMaxExtent() || this.map.maxExtent; - + //determine new tile bounds var tileWidth, tileHeight, tileBounds; var center = bounds.getCenterLonLat(); + //adjust tile bounds to fit in maxExtent restriction - //if it is an overlay and there is a maxExtent restriction - if(this != this.map.baseLayer && maxExt && bounds.containsBounds(maxExt)) { - bounds.bottom = Math.max(maxExt.bottom, bounds.bottom); - bounds.top = Math.min(maxExt.top, bounds.top); - bounds.left = Math.max(maxExt.left, bounds.left); - bounds.right = Math.min(maxExt.right, bounds.right); + //if there is a maxExtent restriction + if(this.maxExtent && bounds.containsBounds(this.maxExtent, true)) { + bounds.bottom = Math.max(this.maxExtent.bottom, bounds.bottom); + bounds.top = Math.min(this.maxExtent.top, bounds.top); + bounds.left = Math.max(this.maxExtent.left, bounds.left); + bounds.right = Math.min(this.maxExtent.right, bounds.right); tileWidth = bounds.getWidth(); tileHeight = bounds.getHeight(); tileBounds = bounds; @@ -742,10 +741,10 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { lon : tileBounds.right, lat : tileBounds.top }); - this.tileSize = { - h : Math.abs(trPx.y - blPx.y), - w : Math.abs(trPx.x - blPx.x) - }; + this.tileSize = new OpenLayers.Size( + Math.abs(trPx.x - blPx.x), + Math.abs(trPx.y - blPx.y) + ); this._resetTileSize = true; } else { @@ -760,6 +759,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { ); if(this._resetTileSize === true) { this.setTileSize(); + delete this._resetTileSize; } } var px = this.map.getLayerPxFromLonLat({ diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index 34abdea092..1fc02c8a7a 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -449,7 +449,7 @@ } function test_Layer_Grid_initSingleTile(t) { - t.plan( 11 ); + t.plan( 19 ); layer = new OpenLayers.Layer.Grid(name, url, params, { singleTile: true, @@ -501,8 +501,46 @@ } }; layer.grid = [[ tile ]]; - layer.initSingleTile(bounds); - + layer.initSingleTile(bounds); + + //test maxExtent restrictions + //reset grid + layer.grid = []; + //more useful mocks + layer.map = { + getLayerPxFromLonLat: function(ul) { + return { + x:ul.lon, + y:ul.lat + }; + }, + getResolution:function(){return 1;} + }; + layer.addTile = function(tileBounds, px) { + t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to addTile to create new tile"); + t.ok(px.x == translatedPX.x && px.y == translatedPX.y, "correct tile px passed to addTile to create new tile"); + return newTile; + }; + tile = { + moveTo: function(tileBounds, px) { + t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to tile.moveTo()"); + t.ok(px.x == translatedPX.x && px.y == translatedPX.y, "correct tile px passed to tile.moveTo()"); + } + }; + //test bound fully contains the maxExtent + //tile bounds -10,10,50,100 + layer.maxExtent = new OpenLayers.Bounds(0,20,40,90); + desiredTileBounds = new OpenLayers.Bounds(0,20,40,90); + translatedPX = {x:0,y:90}; + layer.initSingleTile(bounds); + + //test bound overlaps the maxExtent + bounds = new OpenLayers.Bounds(-10,10,50,100); + layer.maxExtent = new OpenLayers.Bounds(-30,20,40,110); + desiredTileBounds = new OpenLayers.Bounds(-10,20,40,100); + translatedPX = {x:-10,y:100}; + layer.grid = [[ tile ]]; + layer.initSingleTile(bounds); } function test_Layer_Grid_addTileMonitoringHooks(t) { From 3e5081762381248cdbee4e3f1d7982a16db26fff Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Thu, 8 Mar 2012 16:54:50 -0600 Subject: [PATCH 4/6] Correct else code style error --- lib/OpenLayers/Layer/Grid.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 99d8814d52..4716f6d860 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -746,8 +746,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { Math.abs(trPx.y - blPx.y) ); this._resetTileSize = true; - } - else { + } else { tileWidth = bounds.getWidth() * this.ratio; tileHeight = bounds.getHeight() * this.ratio; tileBounds = From 0ff2f9a457aec9f6f75b198e744b0f710654676a Mon Sep 17 00:00:00 2001 From: Matt Priour Date: Fri, 9 Mar 2012 14:26:48 -0600 Subject: [PATCH 5/6] Simplify maxExtent restriction logic and prevent unneeded calls to ``getLayerPxFromLonLat`` --- lib/OpenLayers/Layer/Grid.js | 50 +++++++++++++----------------------- tests/Layer/Grid.html | 14 +++++----- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index c9f59a8e9d..218ff3afb2 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -778,47 +778,33 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { this.clearTileQueue(); //determine new tile bounds - var tileWidth, tileHeight, tileBounds; var center = bounds.getCenterLonLat(); - //adjust tile bounds to fit in maxExtent restriction - //if there is a maxExtent restriction - if(this.maxExtent && bounds.containsBounds(this.maxExtent, true)) { - bounds.bottom = Math.max(this.maxExtent.bottom, bounds.bottom); - bounds.top = Math.min(this.maxExtent.top, bounds.top); - bounds.left = Math.max(this.maxExtent.left, bounds.left); - bounds.right = Math.min(this.maxExtent.right, bounds.right); - tileWidth = bounds.getWidth(); - tileHeight = bounds.getHeight(); - tileBounds = bounds; - var blPx = this.map.getLayerPxFromLonLat({ - lon : tileBounds.left, - lat : tileBounds.bottom - }); - var trPx = this.map.getLayerPxFromLonLat({ - lon : tileBounds.right, - lat : tileBounds.top - }); - this.tileSize = new OpenLayers.Size( - Math.abs(trPx.x - blPx.x), - Math.abs(trPx.y - blPx.y) - ); - this._resetTileSize = true; - } else { - tileWidth = bounds.getWidth() * this.ratio; - tileHeight = bounds.getHeight() * this.ratio; - tileBounds = + var tileWidth = bounds.getWidth() * this.ratio; + var tileHeight = bounds.getHeight() * this.ratio; + var tileBounds = new OpenLayers.Bounds( center.lon - (tileWidth / 2), center.lat - (tileHeight / 2), center.lon + (tileWidth / 2), center.lat + (tileHeight / 2) ); - if(this._resetTileSize === true) { - this.setTileSize(); - delete this._resetTileSize; - } + //adjust tile bounds to fit in maxExtent restriction + //if there is a maxExtent restriction + if(this.maxExtent) { + tileBounds.bottom = Math.max(this.maxExtent.bottom, tileBounds.bottom); + tileBounds.top = Math.min(this.maxExtent.top, tileBounds.top); + tileBounds.left = Math.max(this.maxExtent.left, tileBounds.left); + tileBounds.right = Math.min(this.maxExtent.right, tileBounds.right); + tileWidth = tileBounds.getWidth(); + tileHeight = tileBounds.getHeight(); + var resolution = this.map.getResolution(); + this.tileSize = new OpenLayers.Size( + tileWidth / resolution, + tileHeight / resolution + ); } + var px = this.map.getLayerPxFromLonLat({ lon: tileBounds.left, lat: tileBounds.top diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index 016cf68873..ffff2a3482 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -467,9 +467,8 @@ t.ok(ul.lon === desiredUL.lon && ul.lat === desiredUL.lat, "correct ul passed to translation"); return translatedPX; }, - getResolution: function() { - } - } + getResolution:function(){return 1;} + }; var newTile = { draw: function() { @@ -528,7 +527,7 @@ } }; //test bound fully contains the maxExtent - //tile bounds -10,10,50,100 + //tile bounds -10,10,50,100 -> apply ratio -40,-35,80,145 layer.maxExtent = new OpenLayers.Bounds(0,20,40,90); desiredTileBounds = new OpenLayers.Bounds(0,20,40,90); translatedPX = {x:0,y:90}; @@ -536,9 +535,10 @@ //test bound overlaps the maxExtent bounds = new OpenLayers.Bounds(-10,10,50,100); - layer.maxExtent = new OpenLayers.Bounds(-30,20,40,110); - desiredTileBounds = new OpenLayers.Bounds(-10,20,40,100); - translatedPX = {x:-10,y:100}; + //with ratio applied tile bounds are -40,-35,80,145 + layer.maxExtent = new OpenLayers.Bounds(-50,20,40,150); + desiredTileBounds = new OpenLayers.Bounds(-40,20,40,145); + translatedPX = {x:-40,y:145}; layer.grid = [[ tile ]]; layer.initSingleTile(bounds); } From e52c97f7413b57663e51ae67af358a3083c9c40c Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 9 Mar 2012 23:50:09 +0100 Subject: [PATCH 6/6] Don't check based on layer.maxExtent. layer.maxExtent is always set as soon as the layer is added to a map. Instead, making behavior consistent with tiled layers: don't display outside maxExtent except when displayOutsideMaxExtent is set to true or the layer's extent equals the world bounds for maps with a baseLayer that has wrapDateLine set to true. --- lib/OpenLayers/Layer/Grid.js | 32 ++++++++++++++++++-------------- tests/Layer/Grid.html | 19 ++++++++++++++++--- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 218ff3afb2..adf516364f 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -782,28 +782,32 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { var tileWidth = bounds.getWidth() * this.ratio; var tileHeight = bounds.getHeight() * this.ratio; + var tileBounds = - new OpenLayers.Bounds( - center.lon - (tileWidth / 2), - center.lat - (tileHeight / 2), - center.lon + (tileWidth / 2), - center.lat + (tileHeight / 2) - ); - //adjust tile bounds to fit in maxExtent restriction - //if there is a maxExtent restriction - if(this.maxExtent) { + new OpenLayers.Bounds(center.lon - (tileWidth/2), + center.lat - (tileHeight/2), + center.lon + (tileWidth/2), + center.lat + (tileHeight/2)); + + // adjust tile bounds so they do not exceed maxExtent, except when the + // layer's maxExtent equals the world bounds or displayOutsideMaxExtent + // is set to true + var ignoreMaxExtent = + (this.map.baseLayer.wrapDateLine && + this.maxExtent.equals(this.map.getMaxExtent())) || + this.displayOutsideMaxExtent; + if(!ignoreMaxExtent) { tileBounds.bottom = Math.max(this.maxExtent.bottom, tileBounds.bottom); tileBounds.top = Math.min(this.maxExtent.top, tileBounds.top); tileBounds.left = Math.max(this.maxExtent.left, tileBounds.left); tileBounds.right = Math.min(this.maxExtent.right, tileBounds.right); tileWidth = tileBounds.getWidth(); tileHeight = tileBounds.getHeight(); - var resolution = this.map.getResolution(); - this.tileSize = new OpenLayers.Size( - tileWidth / resolution, - tileHeight / resolution - ); } + var resolution = this.map.getResolution(), + size = this.tileSize; + size.w = (tileWidth / resolution) | 0; + size.h = (tileHeight / resolution) | 0; var px = this.map.getLayerPxFromLonLat({ lon: tileBounds.left, diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index ffff2a3482..1635268b8b 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -449,7 +449,7 @@ } function test_Layer_Grid_initSingleTile(t) { - t.plan( 19 ); + t.plan( 24 ); layer = new OpenLayers.Layer.Grid(name, url, params, { singleTile: true, @@ -462,13 +462,17 @@ var desiredUL = new OpenLayers.LonLat(-40,145); translatedPX = {}; + layer.tileSize = new OpenLayers.Size(); layer.map = { + baseLayer: {wrapDateLine: true}, + getMaxExtent: function() { return new OpenLayers.Bounds(-180,-90,180,90); }, getLayerPxFromLonLat: function(ul) { t.ok(ul.lon === desiredUL.lon && ul.lat === desiredUL.lat, "correct ul passed to translation"); return translatedPX; }, getResolution:function(){return 1;} }; + layer.maxExtent = layer.map.getMaxExtent(); var newTile = { draw: function() { @@ -498,7 +502,7 @@ t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to tile.moveTo()"); t.ok(px == translatedPX, "correct tile px passed to tile.moveTo()"); } - }; + }; layer.grid = [[ tile ]]; layer.initSingleTile(bounds); @@ -507,13 +511,15 @@ layer.grid = []; //more useful mocks layer.map = { + baseLayer: {wrapDateLine: false}, + getMaxExtent: function() { return new OpenLayers.Bounds(-180,-90,180,90); }, getLayerPxFromLonLat: function(ul) { return { x:ul.lon, y:ul.lat }; }, - getResolution:function(){return 1;} + getResolution: function(){return 1;} }; layer.addTile = function(tileBounds, px) { t.ok(tileBounds.equals(desiredTileBounds), "correct tile bounds passed to addTile to create new tile"); @@ -541,6 +547,13 @@ translatedPX = {x:-40,y:145}; layer.grid = [[ tile ]]; layer.initSingleTile(bounds); + t.ok(layer.tileSize.equals(new OpenLayers.Size(80, 125)), "tileSize correct."); + + //test bounds where ratio will be applied on all edges + layer.displayOutsideMaxExtent = true; + desiredTileBounds = new OpenLayers.Bounds(-40,-35,80,145); + layer.initSingleTile(bounds); + t.ok(layer.tileSize.equals(new OpenLayers.Size(120, 180)), "tileSize correct.") } function test_Layer_Grid_addTileMonitoringHooks(t) {