From 8a5842a11c328709b3e61cc7c7fdbae81736b605 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 17 May 2006 14:03:33 +0000 Subject: [PATCH] Add Height/Width to control div via Map.js -- this is good for when elements inside the div are absolutely positioned, and therefore have no width. The LayerSwitcher now sets right, and *unsets* left. This is important because otherwise browsers get confused. git-svn-id: http://svn.openlayers.org/trunk/openlayers@93 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/LayerSwitcher.js | 5 +++-- lib/OpenLayers/Map.js | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 0b8af84232..ac4b4bdb29 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -38,8 +38,9 @@ OpenLayers.Control.LayerSwitcher.prototype = OpenLayers.Control.prototype.draw.apply(this); this.div.style.position = "absolute"; - this.div.style.top = 50; - this.div.style.right = 100; + this.div.style.top = "10px"; + this.div.style.right = "0px"; + this.div.style.left=""; this.div.style.fontFamily = "sans-serif"; this.div.style.color = "white"; this.div.style.fontWeight = "bold"; diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 8c7bc91d2a..dedbf63c6e 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -77,6 +77,8 @@ OpenLayers.Map.prototype = { // the controlDiv is the div that all the controls sit on this.controlDiv = OpenLayers.Util.createDiv( div.id + "_OpenLayers_Control" ); + this.controlDiv.style.width="100%"; + this.controlDiv.style.height="100%"; this.controlDiv.style.zIndex = this.Z_INDEX_BASE["Control"]; this.viewPortDiv.appendChild(this.controlDiv);