OpenLayers OpenLayers

Changeset 5913

Show
Ignore:
Timestamp:
01/27/08 17:59:31 (10 months ago)
Author:
elemoine
Message:

Map.setCenter() should not call Layer.moveTo if inRange has changed to false.
With this patch you should no longer see tiles loading if your layer is out of
range or not visible. Hopefully! r=crschmidt (closes #937)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/WFS.js

    r5828 r5913  
    245245                           !this.tile.bounds.containsBounds(bounds)); 
    246246 
    247         if ( (zoomChanged || firstRendering || (!dragging && outOfBounds)) 
    248              && this.inRange) { 
     247        if (zoomChanged || firstRendering || (!dragging && outOfBounds)) { 
    249248            //determine new tile bounds 
    250249            var center = bounds.getCenterLonLat(); 
  • trunk/openlayers/lib/OpenLayers/Map.js

    r5907 r5913  
    13421342                var layer = this.layers[i]; 
    13431343                if (!layer.isBaseLayer) { 
    1344                      
    1345                     var moveLayer; 
    13461344                    var inRange = layer.calculateInRange(); 
    13471345                    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 longer out of range, the moveTo 
     1349                        // call below will turn on the layer. 
    13511350                        layer.inRange = inRange; 
    1352                         moveLayer = true; 
     1351                        if (!inRange) { 
     1352                            layer.display(false); 
     1353                        } 
    13531354                        this.events.triggerEvent("changelayer"); 
    1354                     } else { 
    1355                         // If nothing has changed, then we only move the layer 
    1356                         // if it is visible and inrange. 
    1357                         moveLayer = (layer.visibility && layer.inRange); 
    13581355                    } 
    1359  
    1360                     if (moveLayer) { 
     1356                    if (inRange && layer.visibility) { 
    13611357                        layer.moveTo(bounds, zoomChanged, dragging); 
    13621358                    }