code: function (bounds, closest) {
          var zoom = null;
          if (this.baseLayer != null) {
              zoom = this.baseLayer.getZoomForExtent(bounds, closest);
          }
          return zoom;
      }
docs: APIMethod: getZoomForExtent
  
  Parameters:
  bounds - {<OpenLayers.Bounds>}
  closest - {Boolean} Find the zoom level that most closely fits the
  specified bounds. Note that this may result in a zoom that does
  not exactly contain the entire extent.
  Default is false.
  
  Returns:
  {Integer} A suitable zoom level for the specified bounds.
  If no baselayer is set, returns null.