Files
iD/js/id/actions/reverse_way.js
John Firebaugh 3e45afbc5e Move history annotation to History#perform/replace
Actions are too low-level for annotations.
2012-12-07 10:35:39 -05:00

9 lines
347 B
JavaScript

// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/AddNodeToWayAction.as
iD.actions.ReverseWay = function(wayId) {
return function(graph) {
var way = graph.entity(wayId),
nodes = way.nodes.slice().reverse();
return graph.replace(way.update({nodes: nodes}));
};
};