Better precision for right and top corners

This commit is contained in:
ahocevar
2012-10-12 03:10:42 +02:00
parent f78d127b1c
commit 66455600c7
2 changed files with 9 additions and 6 deletions

View File

@@ -538,7 +538,7 @@
// do not defer moveGriddedTiles
var isNative = OpenLayers.Animation.isNative;
OpenLayers.Animation.isNative = true;
t.plan(2);
t.plan(3);
var map = new OpenLayers.Map("map", {projection: "EPSG:3857"});
var layer = new OpenLayers.Layer.WMS("wms", "../../img/blank.gif");
@@ -547,11 +547,12 @@
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 after zooming");
map.zoomTo(14);
map.setCenter([0, 0], 14);
var bounds = layer.grid[0][0].bounds.clone();
map.pan(260, 520);
map.pan(-260, -520);
t.eq(layer.grid[0][0].bounds, bounds, "no floating point errors after dragging back and forth");
t.eq(bounds.right, 0, "0 is 0, and not some super small number");
map.destroy();
OpenLayers.Animation.isNative = isNative;