code: function(state) {
          var center, zoom;
          if (this.map.getProjectionObject() == state.projection) { 
              zoom = this.map.getZoomForResolution(state.resolution);
              center = state.center;
          } else {
              center = state.center.clone();
              center.transform(state.projection, this.map.getProjectionObject());
              var sourceUnits = state.units;
              var targetUnits = this.map.getProjectionObject().getUnits() || 
                  this.map.units || this.map.baseLayer.units;
              var resolutionFactor = sourceUnits && targetUnits ? 
                  OpenLayers.INCHES_PER_UNIT[sourceUnits] / OpenLayers.INCHES_PER_UNIT[targetUnits] : 1;
              zoom = this.map.getZoomForResolution(resolutionFactor*state.resolution); 
          }
          this.map.setCenter(center, zoom);
      }
docs: Method: restore
  Update the state with the given object.
  
  Parameters:
  state - {Object} An object representing the state to restore.