code: function(map) {        
          OpenLayers.Layer.prototype.setMap.apply(this, arguments);
  
          if (!this.renderer) {
              this.map.removeLayer(this);
          } else {
              this.renderer.map = this.map;
  
              var newSize = this.map.getSize();
              newSize.w = newSize.w * this.ratio;
              newSize.h = newSize.h * this.ratio;
              this.renderer.setSize(newSize);
          }
      }
docs: Method: setMap
  The layer has been added to the map.
  
  If there is no renderer set, the layer can't be used. Remove it.
  Otherwise, give the renderer a reference to the map and set its size.
  
  Parameters:
  map - {<OpenLayers.Map>}