Ticket #99: layersdisplay.patch
| File layersdisplay.patch, 2.6 kB (added by euzuro, 2 years ago) |
|---|
-
lib/OpenLayers/Layer.js
old new 191 191 * @param {Boolean} dragging 192 192 */ 193 193 moveTo:function(bounds, zoomChanged, dragging) { 194 this.display(this.visibility && this.inRange); 194 var display = this.visibility; 195 if (!this.isBaseLayer) { 196 display = display && this.inRange; 197 } 198 this.display(display); 195 199 }, 196 200 197 201 /** Set the map property for the layer. This is done through an accessor … … 208 212 209 213 this.initResolutions(); 210 214 211 this.inRange = this.calculateInRange(); 212 215 if (!this.isBaseLayer) { 216 this.inRange = this.calculateInRange(); 217 } 213 218 }, 214 219 215 220 /** -
lib/OpenLayers/Map.js
old new 703 703 } 704 704 } 705 705 706 var bounds = this.getExtent(); 707 706 708 //send the move call to the baselayer and all the overlays 707 var bounds = this.getExtent();709 this.baseLayer.moveTo(bounds, zoomChanged, dragging); 708 710 for (var i = 0; i < this.layers.length; i++) { 709 711 var layer = this.layers[i]; 710 711 var inRange = layer.calculateInRange(); 712 if (layer.inRange != inRange) { 713 layer.inRange = inRange; 714 layer.display(layer.visibility && layer.inRange); 715 this.events.triggerEvent("changelayer"); 716 } 717 718 if (layer.visibility && layer.inRange) { 719 layer.moveTo(bounds, zoomChanged, dragging); 720 } 712 if (!layer.isBaseLayer) { 713 714 var moveLayer; 715 var inRange = layer.calculateInRange(); 716 if (layer.inRange != inRange) { 717 layer.inRange = inRange; 718 moveLayer = true; 719 this.events.triggerEvent("changelayer"); 720 } else { 721 moveLayer = (layer.visibility && layer.inRange); 722 } 723 724 if (moveLayer) { 725 layer.moveTo(bounds, zoomChanged, dragging); 726 } 727 } 721 728 } 722 729 723 730 this.events.triggerEvent("move");
