allow controls to live outside the map viewport - with changes to the overview map to handle this (#465)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-01-10 21:56:07 +00:00
parent b79607e1db
commit 6284941ea0
2 changed files with 5 additions and 6 deletions

View File

@@ -480,13 +480,13 @@ OpenLayers.Map.prototype = {
* @param {OpenLayers.Pixel} px
*/
addControlToMap: function (control, px) {
// If a control doesn't have a div at this point, it belongs in the
// viewport.
control.outsideViewport = (control.div != null);
control.setMap(this);
var div = control.draw(px);
if (div) {
// Only elements without parents should be appended to the viewport.
// In IE, even elements without parents are given a parent node
// of type 11 (DOCUMENT_FRAGMENT_NODE).
if(!div.parentNode || (div.parentNode.nodeType == 11)) {
if(!control.outsideViewport) {
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
this.controls.length;
this.viewPortDiv.appendChild( div );