code: function () {
          var scale = null;
          if (this.baseLayer != null) {
              var res = this.getResolution();
              var units = this.baseLayer.units;
              scale = OpenLayers.Util.getScaleFromResolution(res, units);
          }
          return scale;
      }
docs: APIMethod: getScale
  
  Returns:
  {Float} The current scale denominator of the map.
  If no baselayer is set, returns null.