code: function() {
  
          if (this.resolutions != null) {
              return OpenLayers.Layer.prototype.getResolution.apply(this, arguments);
          } else {
              var resolution = null;
              
              var viewSize = this.map.getSize();
              var extent = this.getExtent();
              
              if ((viewSize != null) && (extent != null)) {
                  resolution = Math.max( extent.getWidth()  / viewSize.w,
                                         extent.getHeight() / viewSize.h );
              }
              return resolution;
          }
       }
docs: APIMethod: getResolution
  Get the current map resolution
  
  Returns:
  {Float} Map units per Pixel