Fix to display only one unit on scaleline in IE. Previously, this worked in

most browsers, but not IE. Includes a test, tested on IE6 and IE7. Patch
by zspitzer, r=me, (Closes #1478)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8950 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2009-03-05 13:46:58 +00:00
parent b72748e2c6
commit 930adf45c0
2 changed files with 23 additions and 5 deletions

View File

@@ -189,12 +189,18 @@ OpenLayers.Control.ScaleLine = OpenLayers.Class(OpenLayers.Control, {
var bottomPx = bottomMax / res;
// now set the pixel widths
this.eTop.style.width = Math.round(topPx) + "px";
this.eBottom.style.width = Math.round(bottomPx) + "px";
// and the values inside them
this.eTop.innerHTML = topRounded + " " + topUnits;
this.eBottom.innerHTML = bottomRounded + " " + bottomUnits ;
if (this.eBottom.style.visibility == "visible"){
this.eBottom.style.width = Math.round(bottomPx) + "px";
this.eBottom.innerHTML = bottomRounded + " " + bottomUnits ;
}
if (this.eTop.style.visibility == "visible"){
this.eTop.style.width = Math.round(topPx) + "px";
this.eTop.innerHTML = topRounded + " " + topUnits;
}
},
CLASS_NAME: "OpenLayers.Control.ScaleLine"