Files
iD/js/id/actions/delete_node.js
2012-12-05 16:42:48 -05:00

17 lines
587 B
JavaScript

// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteNodeAction.as
iD.actions.DeleteNode = function(node) {
return function(graph) {
graph.parentWays(node.id)
.forEach(function(parent) {
graph = iD.actions.RemoveWayNode(parent, node)(graph);
});
graph.parentRelations(node.id)
.forEach(function(parent) {
graph = iD.actions.RemoveRelationMember(parent, node)(graph);
});
return graph.remove(node, 'removed a node');
};
};