destroy map objects after using them. add extra test to make sure layer is removed from map on destroy
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2854 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -61,6 +61,8 @@
|
|||||||
t.ok( (layer.maxResolution != clone.maxResolution), "maxresolution of clone reset to new map div");
|
t.ok( (layer.maxResolution != clone.maxResolution), "maxresolution of clone reset to new map div");
|
||||||
t.ok( (layer.minResolution != clone.minResolution), "minresolution of clone reset to new map div");
|
t.ok( (layer.minResolution != clone.minResolution), "minresolution of clone reset to new map div");
|
||||||
|
|
||||||
|
mapone.destroy();
|
||||||
|
maptwo.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_03_Layer_setName (t) {
|
function test_03_Layer_setName (t) {
|
||||||
@@ -159,7 +161,7 @@
|
|||||||
|
|
||||||
|
|
||||||
function test_99_Layer_destroy (t) {
|
function test_99_Layer_destroy (t) {
|
||||||
t.plan( 4 );
|
t.plan( 5 );
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
@@ -174,6 +176,10 @@
|
|||||||
t.eq( layer.map, null, "layer.map is null after destroy" );
|
t.eq( layer.map, null, "layer.map is null after destroy" );
|
||||||
t.eq( layer.options, null, "layer.options is null after destroy" );
|
t.eq( layer.options, null, "layer.options is null after destroy" );
|
||||||
|
|
||||||
|
t.eq(map.layers.length, 0, "layer removed from map");
|
||||||
|
|
||||||
|
map.destroy();
|
||||||
|
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user