making the layerswitcher a little smarter. Instead of fancy 'noEvent' parameters, we just keep track of the state at each redraw. When asked to redraw, we then check first to see if anything has changed before going ahead with the redraw. Also in this patch, we add a 'visibilitychanged' event to the layer's events object -- upon request by users. (Closes #878)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4229 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
|
||||
function test_05_Layer_visibility(t) {
|
||||
|
||||
t.plan(5)
|
||||
t.plan(7);
|
||||
|
||||
var layer = new OpenLayers.Layer('Test Layer');
|
||||
|
||||
@@ -140,6 +140,10 @@
|
||||
layermoved = false;
|
||||
layer.moveTo = function() { layermoved = true; }
|
||||
|
||||
layer.events.register('visibilitychanged', t, function() {
|
||||
this.ok(true, "Visibility changed calls layer event.");
|
||||
});
|
||||
|
||||
layer.setVisibility(false);
|
||||
t.eq(layermoved, false, "Layer didn't move when calling setvis false");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user