"Layer Switcher does not do sufficient layer state information storage",

review by e-dog. (Closes #970)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4336 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-09-16 16:22:45 +00:00
parent f4eb411602
commit 8a3fb3dce3
2 changed files with 36 additions and 2 deletions

View File

@@ -65,7 +65,7 @@
function test_04_Control_LayerSwitcher_redraw (t) {
t.plan( 12 );
t.plan( 19 );
map = new OpenLayers.Map('map');
var layer = new OpenLayers.Layer.WMS("WMS",
@@ -95,12 +95,42 @@
t.eq(false, control.checkRedraw(), "check redraw is false");
control = new OpenLayers.Control.LayerSwitcher();
var myredraw = control.redraw;
control.redraw = function() {
t.ok(true, "redraw called when setting vis");
}
map.addControl(control);
var func = myredraw.bind(control);
func();
markers.setVisibility(false);
t.eq(control.checkRedraw(), true, "check redraw is true after changing layer and not letting redraw happen.");
map.removeControl(control);
control = new OpenLayers.Control.LayerSwitcher();
var myredraw = control.redraw;
control.redraw = function() {
t.ok(true, "redraw called when setting inRange");
}
map.addControl(control);
var func = myredraw.bind(control);
func();
markers.inRange = false;
t.eq(control.checkRedraw(), true, "check redraw is true after changing layer.inRange and not letting redraw happen.");
map.removeControl(control);
control = new OpenLayers.Control.LayerSwitcher();
var myredraw = control.redraw;
control.redraw = function() {
t.ok(true, "redraw called when raising base layer ");
}
map.addControl(control);
var func = myredraw.bind(control);
func();
map.raiseLayer(layer, 1);
t.eq(control.checkRedraw(), true, "check redraw is true after changing layer.inRange and not letting redraw happen.");
map.removeControl(control);
}
function test_05_Control_LayerSwitcher_ascendingw (t) {