OpenLayers OpenLayers

Changeset 2836

Show
Ignore:
Timestamp:
03/21/07 15:03:09 (2 years ago)
Author:
euzuro
Message:

fix for #549 - clearing out of map div on map.destroy(). this fixes many opera tests

Files:

Legend:

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

    r2803 r2836  
    226226            this.controls = null; 
    227227        } 
     228        this.div.innerHTML = ""; 
    228229    }, 
    229230 
  • trunk/openlayers/tests/Control/test_OverviewMap.html

    r2803 r2836  
    2222        t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 4, "Viewport div contains control div" ); 
    2323 
     24        map.destroy(); 
    2425    } 
    2526    function test_03_Control_PanZoom_control_events (t) { 
     
    6566        t.eq(overviewZoom, 0, "Overviewmap zoomcorrect -- second zoom"); 
    6667         
     68        map.destroy(); 
    6769 
    6870    } 
  • trunk/openlayers/tests/Layer/test_WMS.html

    r2803 r2836  
    6363             "div first child is correct image object" ); 
    6464        t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." ); 
     65        map.destroy(); 
    6566    } 
    6667     
     
    7374        t.eq( layer.grid.length, 7, "Grid rows is correct." ); 
    7475        t.eq( layer.grid[0].length, 6, "Grid cols is correct." ); 
    75          
     76        map.destroy(); 
    7677    } 
    7778 
     
    102103 
    103104        layer.grid = null; 
     105        map.destroy(); 
    104106    } 
    105107 
     
    143145 
    144146        t.eq( layer.params.CHICKPEAS, "image/png", "mergeNewParams() makes clean copy of hashtable"); 
     147        map.destroy(); 
    145148    } 
    146149 
     
    172175             tUrl + "?" + OpenLayers.Util.getParameterString(tParams), 
    173176             "getFullRequestString() by default does *not* add SRS value if projection is 'none'"); 
     177        map.destroy(); 
    174178  
    175179    } 
     
    197201        t.eq(parseFloat(tile.imgDiv.style.opacity), 0.6, "Tile opacity is set correctly"); 
    198202 
     203        map.destroy(); 
    199204    }     
    200205     
    201206    function test_20_Layer_WMS_Reproject (t) {  
    202207        t.plan(5); 
     208 
    203209        var map = new OpenLayers.Map('map'); 
    204210        var layer = new OpenLayers.Layer.Google("Google"); 
    205211        map.addLayer(layer); 
    206         layer = new OpenLayers.Layer.WMS(name, url, params, {isBaseLayer: false}); 
    207         layer.isBaseLayer=false; 
    208         map.addLayer(layer); 
     212        wmslayer = new OpenLayers.Layer.WMS(name, url, params, {isBaseLayer: false}); 
     213        wmslayer.isBaseLayer=false; 
     214        map.addLayer(wmslayer); 
    209215        map.setCenter(new OpenLayers.LonLat(0,0), 5); 
    210216        var tile = layer.grid[0][0]; 
     
    213219        t.eq( tile.bounds.bottom.toFixed(6), '11.178402', "bottom side matches" );  
    214220        t.eq( tile.bounds.top.toFixed(6), '21.943046', "top side matches" );  
     221        map.destroy(); 
    215222         
    216223        var map = new OpenLayers.Map('map'); 
     
    220227        var tile = layer.grid[0][0]; 
    221228        t.ok( tile.bounds.equals(new OpenLayers.Bounds(-33.75, 33.75, -22.5, 45)), "okay"); 
     229 
     230        map.destroy(); 
    222231    } 
    223232     
  • trunk/openlayers/tests/test_Map.html

    r2541 r2836  
    319319     
    320320    function test_99_Map_destroy (t) { 
    321         t.plan( 2 );     
     321        t.plan( 3 );     
    322322        map = new OpenLayers.Map('map'); 
    323323        map.destroy(); 
    324324        t.eq( map.layers, null, "map.layers is null after destroy" ); 
    325325        t.eq( map.controls, null, "map.controls is null after destroy" ); 
     326        t.eq( map.div.innerHTML, "", "map's div cleared out"); 
    326327    } 
    327328  // --> 
  • trunk/openlayers/tests/test_Marker.html

    r2829 r2836  
    4343 
    4444        t.ok( !marker2.onScreen(), "marker knows it's offscreen" ); 
    45          
     45        map.destroy(); 
    4646    } 
    4747 
     
    7171 
    7272        t.eq(parseFloat(marker.icon.imageDiv.style.opacity), 0.5, "marker.setOpacity() works"); 
     73        map.destroy(); 
    7374    } 
    7475    function test_04_Marker_moveTo(t) { 
     
    102103        t.eq(marker.lonlat.lon, map.getExtent().left, "on left edge of map");  
    103104        t.eq(marker.lonlat.lat, map.getExtent().top, "on top edge of map");  
     105        map.destroy(); 
    104106     
    105107    }