delete ways, too
[potlatch2.git] / net / systemeD / potlatch2 / controller / DrawWay.as
index 67f0be910f483fdb6e8c184206f27daddca19c86..29a3f7d9a544349ebad1deb7e4d1656a3bed211b 100644 (file)
@@ -95,10 +95,9 @@ package net.systemeD.potlatch2.controller {
                
                protected function stopDrawing():ControllerState {
                        if ( selectedWay.length<2) {
-                               // ** probably needs to call a proper 'delete way' method
                                controller.map.setHighlight(selectedWay, { showNodes: false });
-                               selectedWay.removeAllNodes();
-                               delete controller.map.ways[selectedWay.id];
+                               selectedWay.remove();
+                               // delete controller.map.ways[selectedWay.id];
                                return new NoSelection();
                        } else if ( leaveNodeSelected ) {
                            return new SelectedWayNode(selectedWay, selectedWay.getNode(editEnd ? selectedWay.length - 1 : 0));