diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index d3688e8ae2..95bc2ee745 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -13,19 +13,15 @@ OpenLayers.Control.Scale.prototype = /** @type DOMElement */ element: null, - /** @type String */ - units: 'dd', - /** * @constructor * * @param {DOMElement} element * @param {String} base */ - initialize: function(element, units) { + initialize: function(element) { OpenLayers.Control.prototype.initialize.apply(this, arguments); this.element = element; - if (units) this.units = units; }, /** @@ -53,11 +49,9 @@ OpenLayers.Control.Scale.prototype = * */ updateScale: function() { - var res = this.map.getResolution(); - if (!res) return; + var scale = this.map.getScale(); + if (!scale) return; - var scale = res * OpenLayers.INCHES_PER_UNIT[this.units] - * OpenLayers.DOTS_PER_INCH; if (scale >= 9500 && scale <= 950000) { scale = Math.round(scale / 1000) + "K"; } else if (scale >= 950000) {