Ticket #878: layer_visibility.patch
| File layer_visibility.patch, 1.5 kB (added by crschmidt, 1 year ago) |
|---|
-
tests/test_Layer.html
old new 118 118 119 119 function test_05_Layer_visibility(t) { 120 120 121 t.plan( 5)121 t.plan(7) 122 122 123 123 var layer = new OpenLayers.Layer('Test Layer'); 124 t.visibilitychanged = 0; 125 layer.events.register("visibilitychanged", t, function() { 126 this.visibilitychanged++ 127 this.ok(true, "Visibility changed called: time " + this.visibilitychanged + " of 2"); 128 }); 124 129 125 130 t.eq(layer.getVisibility(), true, "default for layer creation is visible"); 126 131 -
lib/OpenLayers/Layer.js
old new 32 32 * Constant: EVENT_TYPES 33 33 * {Array(String)} Supported application event types 34 34 */ 35 EVENT_TYPES: [ "loadstart", "loadend", "loadcancel" ],35 EVENT_TYPES: [ "loadstart", "loadend", "loadcancel", "visibilitychanged"], 36 36 37 37 /** 38 38 * APIProperty: events`` … … 504 504 this.visibility = visibility; 505 505 this.display(visibility); 506 506 this.redraw(); 507 this.events.triggerEvent("visibilitychanged"); 507 508 if ((this.map != null) && 508 509 ((noEvent == null) || (noEvent == false))) { 509 510 this.map.events.triggerEvent("changelayer");
