code: function() {
          var activated = OpenLayers.Control.prototype.activate.call(this);
          if(activated) {
              if(this.layer && this.layer.events) {
                  this.layer.events.on({
                      sketchstarted: this.onSketchModified,
                      sketchmodified: this.onSketchModified,
                      vertexmodified: this.onVertexModified,
                      scope: this
                  });
              }
          }
          return activated;
      }
docs: APIMethod: activate
  Activate the control.  Activating the control registers listeners for
  editing related events so that during feature creation and
  modification, moving vertices will trigger snapping.