diff --git a/NOTES.md b/NOTES.md index a7435d1e4..8db04d9dd 100644 --- a/NOTES.md +++ b/NOTES.md @@ -3,14 +3,44 @@ iD implements a [persistent data structure](http://en.wikipedia.org/wiki/Persistent_data_structure) over the OSM data model. -To be clear, this data model is something like - +The data model of OSM is something like root -> relations (-> relations) -> ways -> nodes \ \> nodes \- ways -> nodes \- nodes +In English: + +* Relations have (ways, nodes, relations) +* Ways have (nodes) +* Nodes have () + +## Persistence + +The idea is that we keep every _changed_ of an object around, but reuse +unchanged objects between versions. + +So, possibly the datastructure on first load is like + +```javascript +{ + 1: [1], + 2: [2], + 3: [3] +} +``` + +After one edit in which the object formerly known as `1` acquires a new +version, it is like: + +```javascript +{ + 1: [4, 1], + 2: [2, 2], + 3: [3, 3] +} +``` ## Performance diff --git a/docs/events.txt b/docs/events.txt deleted file mode 100755 index 0a3a7e1ac..000000000 --- a/docs/events.txt +++ /dev/null @@ -1,14 +0,0 @@ -== Entities == - -Listeners are created in NodeUI and WayUI for each item's hitzone. - -MouseEvents proceed like this: - -* Event triggered on EntityUI, calling EntityUI.entityMouseEvent(event) -* This calls Controller.entityMouseEvent(event,entityUI) -* This updates the state from ControllerState.processMouseEvent(event,entityUI) - -== Non-entities == - -* onmousemove in Map.js calls processMove, which calls Controller.entityMouseEvent(event,null) -* onclick in Map.js calls clickSurface, which calls Controller.entityMouseEvent(event,null) diff --git a/docs/todo.txt b/docs/todo.txt deleted file mode 100755 index 2f8dcd48e..000000000 --- a/docs/todo.txt +++ /dev/null @@ -1,62 +0,0 @@ -DrawWay to do: -* start from a POI node ("convert into way?") -* still allow dragging the map - -Drag and drop to do: -* presentation -* cope with dragging onto anything, not just blank areas of the map - -Next to do: -* drag nodes -* remove trailing commas (for IE!) - -Renderer to do -* hover! -* NodeUI renderer needs a default width/height so that clicking a POI without them still shows the highlight -* Fix 'special values' in RuleSet - they're not really special for SVG etc. -* Labels other than text-on-path -* Node headings (for locks etc.) -* Dragging needs tolerance (i.e. less than n pixels and n seconds) - -Tagging to do -* dijitTooltipConnector is wrong when an entityUI is clicked - -ControllerStates to do: -* Try to share as much code as possible -* Draw way controller states: - - NoSelection (next click starts, or selects) - - SelectedWay (next click starts, or selects) - - SelectedPOINode (next click starts, or selects) - - DrawWay (next click continues, or completes and edits) - -Events -* EntityMouseEvent seems to get called twice most of the time when moving the mouse around in DrawWay -* Maybe we should just broadcast to the Controller, and the Controller knows what to do. In other words: - - undo says "the following entities have changed: way 5, node 3, way 7, relation 8" - - the Controller gets the message and invokes a redraw - - no need for anything else to listen - ------------------------------------------------- - -Modes: -1. Add point -2. Add street or shape -3. Edit object - 3a. edit tags (and relation memberships, etc.) - 3b. move object - 3c. delete object - 3d. extend way - 3e. geometry operations (like P2 Toolbox) - -In 'edit': double-clicking goes into "draw shape"; double-clicking then Enter creates POI - -Needs greyed-out "step-by-step" window for draw modes: - Click at the start point to begin drawing - Add each point, click by click - Double-click when you've finished - Then choose what it is - -With buttons at the bottom: - Finish - Cancel - Undo last