change map.addControlToMap to allow controls outside viewport, from

Ticket #445: externalControl.patch. Closes #445. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2087 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-12-22 17:19:23 +00:00
parent 9c6817f5d6
commit 46767efed2

View File

@@ -483,9 +483,12 @@ OpenLayers.Map.prototype = {
control.setMap(this);
var div = control.draw(px);
if (div) {
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
this.controls.length;
this.viewPortDiv.appendChild( div );
// only elements without parents should be appended to the viewport
if(!div.parentNode) {
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
this.controls.length;
this.viewPortDiv.appendChild( div );
}
}
},