Absolute calculation of tile bounds

This avoids cumulated tile bounds errors for layer types that do not use a
tile row/column index in requests (e.g. WMS).
This commit is contained in:
ahocevar
2012-10-10 12:22:57 +02:00
parent 0b3f582e10
commit d4f011d00c
2 changed files with 22 additions and 4 deletions

View File

@@ -533,6 +533,18 @@
map.destroy();
}
function test_tileBounds(t) {
t.plan(1);
var map = new OpenLayers.Map("map", {projection: "EPSG:3857"});
var layer = new OpenLayers.Layer.WMS("wms", "../../img/blank.gif");
map.addLayer(layer);
map.setCenter([0, 0], 1);
map.pan(2, -100);
map.zoomIn();
t.eq(layer.grid[1][0].bounds, new OpenLayers.Bounds(-10018754.17, 0, 0, 10018754.17), "no floating point errors");
map.destroy();
}
</script>