From 2e3ff459b26e5b115ce09fbcace14b6312c7d592 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 16 Aug 2006 17:19:28 +0000 Subject: [PATCH] Change Scale control to use getScale() from map. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1245 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Scale.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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) {