Changeset 4392
- Timestamp:
- 09/19/07 09:12:20 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/tcoulter/openlayers/lib/OpenLayers/Control/UndoRedo.js
r4387 r4392 138 138 if (this.featureUndoStack.length == 0) return; 139 139 140 currentFeatureId = this.featureUndoStack.pop(); 141 currentFeatureUndoStack = this.featureUndoHash[currentFeatureId] 142 currentFeature = currentFeatureUndoStack.pop(); 143 144 currentFeature.layer.eraseFeatures(currentFeature); 145 this.featureRedoStack.push(currentFeature); 140 currentFeature = this.featureUndoStack.pop(); 141 currentFeatureUndoStack = this.featureUndoHash[currentFeature.id] 142 currentGeometry = currentFeatureUndoStack.pop(); 143 currentFeature.layer.removeFeatures(currentFeature) 144 145 if (currentFeatureUndoStack.length == 0) return; 146 147 //alert(currentFeatureUndoStack[currentFeatureUndoStack.length-1]) 148 var feature = new OpenLayers.Feature.Vector(currentFeatureUndoStack[currentFeatureUndoStack.length-1]); 149 feature.id = currentFeature.id 150 currentFeature.layer.addFeatures(feature) 151 //currentFeature.layer.drawFeature(feature) 152 153 154 //this.featureRedoStack.push(geometry); 146 155 147 if (currentFeatureUndoStack.length == 0) return; 148 149 nextFeature = currentFeatureUndoStack[currentFeatureUndoStack.length-1] 150 nextFeature.layer.drawFeature(nextFeature, null); 156 151 157 } 152 158 else if (this.isValidRedo(this.keydownStack)) … … 194 200 // existingFeature.layer.removeFeatures(existingFeature); 195 201 // } 196 clone = feature.clone197 clone.layer = feature.layer198 //clone.geometry = feature.geometry.clone199 202 200 203 if (this.featureUndoHash[feature.id] == null) this.featureUndoHash[feature.id] = [] 201 204 202 this.featureUndoStack.push(feature .id);203 this.featureUndoHash[feature.id].push( clone)205 this.featureUndoStack.push(feature); 206 this.featureUndoHash[feature.id].push(feature.geometry.clone) 204 207 }, 205 208
