code: function(map) {
          OpenLayers.Control.prototype.setMap.apply(this, arguments);
  
          this.map.events.on({
              addlayer: this.redraw,
              changelayer: this.redraw,
              removelayer: this.redraw,
              changebaselayer: this.redraw,
              scope: this
          });
          if (this.outsideViewport) {
              this.events.attachToElement(this.div);
              this.events.register("buttonclick", this, this.onButtonClick);
          } else {
              this.map.events.register("buttonclick", this, this.onButtonClick);
          }
      }
docs: Method: setMap
  
  Properties:
  map - {<OpenLayers.Map>}