Naturally layer.map is 0 if we never add it to a map in the first place...

git-svn-id: http://svn.openlayers.org/trunk/openlayers@197 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-19 22:11:07 +00:00
parent 9685524e26
commit 2684454343
3 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,8 @@
function test_99_Layer_destroy (t) {
t.plan( 1 );
layer = new OpenLayers.Layer('Test Layer');
var map = new OpenLayers.Map('map');
map.addLayer(layer);
layer.destroy();
t.eq( layer.map, null, "layer.map is null after destroy" );
}
@@ -22,5 +24,6 @@
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>

View File

@@ -24,6 +24,8 @@
function test_99_Layer_Marker_destroy (t) {
t.plan( 1 );
layer = new OpenLayers.Layer.Marker('Test Layer');
var map = new OpenLayers.Map('map');
map.addLayer(layer);
layer.destroy();
t.eq( layer.map, null, "layer.map is null after destroy" );
}

View File

@@ -43,6 +43,8 @@
function test_99_Layer_WMS_destroy (t) {
t.plan( 1 );
layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'});
var map = new OpenLayers.Map('map');
map.addLayer(layer);
layer.destroy();
t.eq( layer.map, null, "layer.map is null after destroy" );
}