From 3ed14463f28dcd5c2d440dd34e5c4096d489eefc Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 22 Mar 2007 19:47:48 +0000 Subject: [PATCH] second patch to fix #549. this time, instead of just clearing out everything in the div, it removes only what it added. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2858 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 5 ++++- tests/test_Map.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 6c544d979b..1005cbba89 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -228,7 +228,10 @@ OpenLayers.Map.prototype = { } this.controls = null; } - this.div.innerHTML = ""; + if (this.viewPortDiv) { + this.div.removeChild(this.viewPortDiv); + } + this.viewPortDiv = null; }, /** diff --git a/tests/test_Map.html b/tests/test_Map.html index 2df4e207b0..af38301d80 100644 --- a/tests/test_Map.html +++ b/tests/test_Map.html @@ -367,7 +367,7 @@ map.destroy(); t.eq( map.layers, null, "map.layers is null after destroy" ); t.eq( map.controls, null, "map.controls is null after destroy" ); - t.eq( map.div.innerHTML, "", "map's div cleared out"); + t.eq( map.viewPortDiv, null, "map's viewportDiv nullified"); } // -->