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:
@@ -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>
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user