Fixing stray last node.

This commit is contained in:
Tom MacWright
2012-12-06 16:00:06 -05:00
parent 517f29131d
commit 9006a746be
+8 -6
View File
@@ -4,12 +4,12 @@ iD.modes.DrawRoad = function(way_id, direction) {
};
mode.enter = function() {
mode.map.dblclickEnable(false);
mode.map.hint('Click to add more points to the road. ' +
mode.map.dblclickEnable(false)
.dragEnable(false)
.fastEnable(false)
.hint('Click to add more points to the road. ' +
'Click on other roads to connect to them, and double-click to ' +
'end the road.');
mode.map.dragEnable(false);
mode.map.fastEnable(false);
var index = (direction === 'forward') ? undefined : -1,
node = iD.Node({loc: mode.map.mouseCoordinates(), tags: { elastic: true } }),
@@ -47,6 +47,8 @@ iD.modes.DrawRoad = function(way_id, direction) {
mode.history.graph().entity(lastNode), index));
}
mode.history.replace(iD.actions.DeleteNode(node));
return finish(iD.modes.Select(way));
} else {
// connect a way to an existing way
@@ -87,8 +89,8 @@ iD.modes.DrawRoad = function(way_id, direction) {
};
mode.exit = function() {
mode.map.hint(false);
mode.map.fastEnable(true);
mode.map.hint(false).fastEnable(true);
mode.map.surface
.on('mousemove.drawroad', null)
.on('click.drawroad', null);