Potlatch 2: main outstanding issues
-----------------------------------
-== Code tidying ==
-
-* A fair amount of the mouse-handling in each ControllerState is shared with others -
- and some probably should be (e.g. unhovering). Can we refactor?
-
-
== Core geometry ==
* Undo/redo: split
-* Remove node from this way only
-* Backspace
-* Not messing up relations when splitting ways
+* Remove node from this way only (will require SelectedWayNode to become aware of currently selected index)
+* Bit more work required on relations when splitting ways
== Vector background layers ==
* TagTransform (cf http://wiki.openstreetmap.org/wiki/Osmosis/TagTransform)
-* Simplify (e.g. GPX files)
* Import from OSM (is this worth sharing with the XML API stuff?)
* Non-900913 projections
* Plugin support
-* Ability to specify that a node should be a point in a way, for example for crossings
== Tag editing ==
* The area of pois for dragging on to the map should have a search, with synonyms and also be categorised like the lines are.
* Bug where the wrong feature is used, when an item that is dragged from the list when an POI has no icon.
* Checkboxes, for example what you can recycle, or whether something is a bridge or tunnel
+* Ability to specify that a node should be a point in a way, for example for crossings
== UI ==
package net.systemeD.potlatch2.controller {
import flash.events.*;
import flash.geom.*;
+ import flash.ui.Keyboard;
import net.systemeD.potlatch2.EditController;
import net.systemeD.halcyon.connection.*;
import net.systemeD.halcyon.Elastic;
override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
if ( event.keyCode == 13 || event.keyCode == 27 ) { return stopDrawing(); }
+ else if (event.keyCode == Keyboard.BACKSPACE) { return backspaceNode(MainUndoStack.getGlobalStack().addAction); }
return this;
}
selectedWay.insertNode(0, node, performAction);
}
+ protected function backspaceNode(performAction:Function):ControllerState {
+ var node:Node;
+ var undo:CompositeUndoableAction = new CompositeUndoableAction("Remove node");
+ var newDraw:int;
+ if (editEnd) {
+ node=selectedWay.getNode(selectedWay.length-1);
+ selectedWay.removeNodeByIndex(selectedWay.length-1, undo.push);
+ newDraw=selectedWay.length-2;
+ } else {
+ node=selectedWay.getNode(0);
+ selectedWay.removeNodeByIndex(0, undo.push);
+ newDraw=0;
+ }
+ if (node.numParentWays==1) {
+ controller.connection.unregisterPOI(node);
+ node.remove(undo.push);
+ }
+ MainUndoStack.getGlobalStack().addAction(undo);
+
+ if (newDraw>=0 && newDraw<=selectedWay.length-1) {
+ var mouse:Point = new Point(selectedWay.getNode(newDraw).lon, selectedWay.getNode(newDraw).latp);
+ elastic.start = mouse;
+ return this;
+ } else {
+ return new NoSelection();
+ }
+ }
+
override public function enterState():void {
super.enterState();