press '/' to cycle through overlapping ways
[potlatch2.git] / net / systemeD / potlatch2 / controller / SelectedWayNode.as
index 9fac57967371ede08b9b6148537257fe7c8a43a0..549eb02625d0a16bb8e4a42deb26c63eac5b1396 100644 (file)
@@ -1,6 +1,7 @@
 package net.systemeD.potlatch2.controller {
        import flash.events.*;
        import flash.ui.Keyboard;
+       import flash.geom.Point;
     import net.systemeD.potlatch2.EditController;
     import net.systemeD.halcyon.connection.*;
     import net.systemeD.halcyon.connection.actions.*;
@@ -68,6 +69,7 @@ package net.systemeD.potlatch2.controller {
                                case 88:                                        return splitWay();                                              // 'X'
                                case 82:                                        repeatTags(firstSelected); return this; // 'R'
                                case 87:                                        return new SelectedWay(parentWay);              // 'W'
+                               case 191:                                       return cycleWays();                                             // '/'
                 case 74:                    if (event.shiftKey) { return unjoin() }; return this;// 'J'
                                case Keyboard.BACKSPACE:        return deleteNode();
                                case Keyboard.DELETE:           return deleteNode();
@@ -80,6 +82,15 @@ package net.systemeD.potlatch2.controller {
                        return parentWay;
                }
 
+               private function cycleWays():ControllerState {
+                       var wayList:Array=firstSelected.parentWays;
+                       wayList.splice(wayList.indexOf(parentWay),1);
+                       return new SelectedWay(wayList[0],
+                                              new Point(controller.map.lon2coord(Node(firstSelected).lon),
+                                                        controller.map.latp2coord(Node(firstSelected).latp)),
+                                              wayList.concat(parentWay));
+               }
+
                override public function enterState():void {
             selectNode(parentWay,initIndex);
                        controller.map.setPurgable(selection,false);