Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Matt Walker
2012-10-13 19:59:41 +01:00
13 changed files with 228 additions and 226 deletions
+4 -1
View File
@@ -40,7 +40,7 @@
return;
}
t.plan(3);
t.plan(4);
OpenLayers.Control.CacheWrite.clearCache();
var length = window.localStorage.length;
@@ -68,6 +68,9 @@
// content will be null for browsers that have localStorage but no canvas support
var content = canvasContext ? canvasContext.canvas.toDataURL("image/png") : null;
t.eq(window.localStorage.getItem("olCache_"+url), content, "localStorage contains correct image data");
layer.events.triggerEvent('tileloaded', {aborted: true, tile: layer.grid[1][1]});
t.eq(window.localStorage.length, length + (canvasContext ? tiles-1 : 0), "tile aborted during load not cached");
var key = Math.random();
window.localStorage.setItem(key, "bar");
+24
View File
@@ -533,6 +533,30 @@
map.destroy();
}
function test_tileBounds(t) {
// do not defer moveGriddedTiles
var isNative = OpenLayers.Animation.isNative;
OpenLayers.Animation.isNative = true;
t.plan(3);
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 after zooming");
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;
}
</script>
+3 -3
View File
@@ -154,9 +154,9 @@
var m = new OpenLayers.Map('map', {adjustZoom: function(z) {return z;}});
m.addLayer(layer);
m.zoomToMaxExtent();
t.eq(layer.grid[5][7].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=-256&s=221471921.25", "grid[5][7] kamap is okay");
t.eq(layer.grid[5][6].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=0&s=221471921.25", "grid[5][6] kamap is okay");
t.eq(layer.grid[5][5].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=-256&s=221471921.25", "grid[5][5] is okay");
t.eq(layer.grid[4][7].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=-256&s=221471921.25", "grid[5][7] kamap is okay");
t.eq(layer.grid[4][6].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=0&s=221471921.25", "grid[5][6] kamap is okay");
t.eq(layer.grid[4][5].url, "http://www.openlayers.org/world/index.php?g=satellite&map=world&i=jpeg&t=0&l=-256&s=221471921.25", "grid[5][5] is okay");
t.ok(layer.grid[7][6].url == null, "no latitudinal wrapping - tile not loaded if outside maxExtent");
m.destroy();
}