Changeset 3041
- Timestamp:
- 04/10/07 06:30:49 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer.js (modified) (1 diff)
- trunk/openlayers/tests/test_Layer.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer.js
r3035 r3041 348 348 this.visibility = visibility; 349 349 this.display(visibility); 350 if ( this.map != null) {350 if (visibility && this.map != null) { 351 351 var extent = this.map.getExtent(); 352 352 if (extent != null) { trunk/openlayers/tests/test_Layer.html
r2854 r3041 119 119 function test_05_Layer_visibility(t) { 120 120 121 t.plan( 3)121 t.plan(5) 122 122 123 123 var layer = new OpenLayers.Layer('Test Layer'); … … 130 130 layer.setVisibility(true); 131 131 t.eq(layer.getVisibility(), true, "setVisibility true works"); 132 133 // Need a map in order to have moveTo called. 134 // Tests added for #654. 135 var layer = new OpenLayers.Layer.WMS('Test Layer','http://example.com'); 136 var m = new OpenLayers.Map('map'); 137 m.addLayer(layer); 138 m.zoomToMaxExtent(); 139 140 layermoved = false; 141 layer.moveTo = function() { layermoved = true; } 142 143 layer.setVisibility(false); 144 t.eq(layermoved, false, "Layer didn't move when calling setvis false"); 145 146 layer.setVisibility(true); 147 t.eq(layermoved, true, "Layer moved when calling setvis true."); 132 148 133 149 }
