diff --git a/NOTES.md b/NOTES.md index 9cf98e51c..1cbbef6c5 100644 --- a/NOTES.md +++ b/NOTES.md @@ -80,3 +80,27 @@ which refer to elements, so we want to have real references of those elements, but we don't have the data yet. Thus when the Connection encounters a new object but has a non-loaded representation of it, the non-loaded version is replaced. + +## Prior Art + +JOSM and Potlatch 2 appear to implement versioning in the same way, but having +an undo stack: + +```java +// src/org/openstreetmap/josm/actions/MoveNodeAction.java +Main.main.undoRedo.add(new MoveCommand(n, coordinates)); + +// src/org/openstreetmap/josm/command/MoveCommand.java + +/** + * List of all old states of the objects. + */ +private List oldState = new LinkedList(); + +@Override public boolean executeCommand() { +// ... +} +@Override public void undoCommand() { +// ... +} +``` diff --git a/js/iD/Node.js b/js/iD/Node.js index 8ef6a617e..927d69927 100644 --- a/js/iD/Node.js +++ b/js/iD/Node.js @@ -8,7 +8,6 @@ iD.Node = function(id, lat, lon, tags, loaded) { }; iD.Node.prototype = { - type: 'node', intersects: function(extent) { @@ -17,5 +16,4 @@ iD.Node.prototype = { (this.lat <= extent[0][1]) && (this.lat >= extent[1][1]); } - }; diff --git a/js/iD/Relation.js b/js/iD/Relation.js index 9e8968732..a72968e9f 100644 --- a/js/iD/Relation.js +++ b/js/iD/Relation.js @@ -11,5 +11,3 @@ iD.Relation.prototype = { intersects: function() { return true; } }; - -// iD.Util.extend(iD.Relation, iD.Entity);