OpenLayers OpenLayers

Changeset 2744

Show
Ignore:
Timestamp:
03/13/07 21:00:28 (2 years ago)
Author:
euzuro
Message:

the addition of a component to a collection no longer should trigger the recalculation of the bounds. rather, it should clear the bounds cache for it to be recalculated next time it is needed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/vector-2.4/tests/Geometry/test_Collection.html

    r2498 r2744  
    151151        t.ok(true, "no breakage, no executage from null input")         
    152152 
    153         OpenLayers.Geometry.Collection.prototype._extendBounds =  
    154             OpenLayers.Geometry.Collection.prototype.extendBounds; 
    155         OpenLayers.Geometry.Collection.prototype.extendBounds =  
    156             function(bounds) { g_extendbounds = bounds; }; 
    157  
    158153      //good component 
    159154        var component = new OpenLayers.Geometry.Point(3,4); 
    160155        coll.addComponent(component);       
    161156          
    162         var testBounds = new OpenLayers.Bounds(3,4,3,4);  
    163  
    164         t.ok(g_extendbounds.equals(testBounds), "collection's bounds properly extended"); 
    165  
     157        t.ok(coll.bounds == null, "bounds cache correctly cleared");          
     158          
    166159        var foundComponent = false; 
    167160        for(var i=0; i< coll.components.length; i++) { 
     
    171164        } 
    172165        t.ok(foundComponent, "component added to internal array"); 
    173  
    174         OpenLayers.Geometry.Collection.prototype.extendBounds =  
    175             OpenLayers.Geometry.Collection.prototype._extendBounds; 
    176166 
    177167    }