Ticket #937: patch-937-r5899-C0.diff
| File patch-937-r5899-C0.diff, 1.7 kB (added by elemoine, 10 months ago) |
|---|
-
lib/OpenLayers/Map.js
old new 1341 1341 for (var i = 0; i < this.layers.length; i++) { 1342 1342 var layer = this.layers[i]; 1343 1343 if (!layer.isBaseLayer) { 1344 1345 var moveLayer;1346 1344 var inRange = layer.calculateInRange(); 1347 1345 if (layer.inRange != inRange) { 1348 // Layer property has changed. We are going 1349 // to call moveLayer so that the layer can be turned 1350 // off or on. 1346 // the inRange property has changed. If the layer is 1347 // no longer in range, we turn it off right away. If 1348 // the layer is no lonnger out of range, the moveTo 1349 // call below will turn on the layer. 1351 1350 layer.inRange = inRange; 1352 moveLayer = true; 1351 if (!inRange) { 1352 layer.display(false); 1353 } 1353 1354 this.events.triggerEvent("changelayer"); 1354 } else {1355 // If nothing has changed, then we only move the layer1356 // if it is visible and inrange.1357 moveLayer = (layer.visibility && layer.inRange);1358 1355 } 1359 1360 if (moveLayer) { 1356 if (inRange && layer.visibility) { 1361 1357 layer.moveTo(bounds, zoomChanged, dragging); 1362 1358 } 1363 1359 }
