OpenLayers OpenLayers

Ticket #787: removeClearArray.2.patch

File removeClearArray.2.patch, 1.6 kB (added by euzuro, 1 year ago)

marked deprecated instead of deleted

  • tests/test_Util.html

    old new  
    3030    } 
    3131 
    3232    function test_03_Util_Array(t) { 
    33         t.plan( 2 ); 
     33        t.plan( 1 ); 
    3434 
    3535        var array = new Array(1,2,3,4,5); 
    3636 
    3737        OpenLayers.Util.removeItem(array, 3); 
    3838        t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");     
    39  
    40         OpenLayers.Util.clearArray(array); 
    41         t.eq( array.toString(), "", "Util.clearArray works");     
    42          
    4339    } 
    4440 
    4541    function test_04_Util_createDiv(t) { 
  • lib/OpenLayers/Util.js

    old new  
    7171 
    7272/** 
    7373 * Function: clearArray 
    74 */ 
     74 * *Deprecated*.  
     75 *  
     76 * Parameters: 
     77 * array - {Array} 
     78 */ 
    7579OpenLayers.Util.clearArray = function(array) { 
    7680    array.length = 0; 
    7781}; 
  • lib/OpenLayers/Layer/WFS.js

    old new  
    385385        if (this.tile) { 
    386386            if (this.vectorMode) { 
    387387                this.renderer.clear(); 
    388                 OpenLayers.Util.clearArray(this.features)
     388                this.features.length = 0
    389389            } else {    
    390390                this.clearMarkers(); 
    391                 OpenLayers.Util.clearArray(this.markers)
     391                this.markers.length = 0
    392392            }     
    393393            this.tile.draw(); 
    394394        }