diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 40dabc4a10..2236a185aa 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -1000,7 +1000,7 @@ OpenLayers.Map = OpenLayers.Class({ removeControl: function (control) { //make sure control is non-null and actually part of our map if ( (control) && (control == this.getControl(control.id)) ) { - if (!control.outsideViewport && control.div) { + if (control.div && (control.div.parentNode == this.viewPortDiv)) { this.viewPortDiv.removeChild(control.div); } OpenLayers.Util.removeItem(this.controls, control);