code: function(state) {
          if (state == OpenLayers.State.UPDATE) {
              switch (this.state) {
                  case OpenLayers.State.UNKNOWN:
                  case OpenLayers.State.DELETE:
                      this.state = state;
                      break;
                  case OpenLayers.State.UPDATE:
                  case OpenLayers.State.INSERT:
                      break;
              }
          } else if (state == OpenLayers.State.INSERT) {
              switch (this.state) {
                  case OpenLayers.State.UNKNOWN:
                      break;
                  default:
                      this.state = state;
                      break;
              }
          } else if (state == OpenLayers.State.DELETE) {
              switch (this.state) {
                  case OpenLayers.State.INSERT:
                      // the feature should be destroyed
                      break;
                  case OpenLayers.State.DELETE:
                      break;
                  case OpenLayers.State.UNKNOWN:
                  case OpenLayers.State.UPDATE:
                      this.state = state;
                      break;
              }
          } else if (state == OpenLayers.State.UNKNOWN) {
              this.state = state;
          }
      }
docs: Method: toState
  Sets the new state
  
  Parameters:
  state - {String}