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"); } // -->