make Layer.redraw not unconditionally set zoomChanged to true in moveTo
This commit is contained in:
@@ -342,6 +342,38 @@
|
||||
t.ok(tile.imgDiv == null, "image reference removed from tile");
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
// test for https://github.com/openlayers/openlayers/pull/36
|
||||
// (more an integration test than a unit test)
|
||||
function test_olImageLoadError(t) {
|
||||
t.plan(2);
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS("invalid", "", {layers: 'basic'});
|
||||
map.addLayer(layer);
|
||||
|
||||
var size = new OpenLayers.Size(5, 6);
|
||||
var position = new OpenLayers.Pixel(20, 30);
|
||||
var bounds = new OpenLayers.Bounds(1, 2, 3, 4);
|
||||
|
||||
var tile = new OpenLayers.Tile.Image(layer, position, bounds, null, size);
|
||||
tile.draw();
|
||||
|
||||
t.delay_call(0.1, function() {
|
||||
|
||||
// check initial state
|
||||
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olImageLoadError'),
|
||||
'tile image has the olImageLoadError class (init state)');
|
||||
|
||||
layer.setVisibility(false);
|
||||
layer.setVisibility(true);
|
||||
|
||||
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olImageLoadError'),
|
||||
'tile image still has the olImageLoadError class');
|
||||
|
||||
map.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user