Files
iD/js/id/actions/move_way.js
2012-12-21 12:10:44 -08:00

15 lines
453 B
JavaScript

iD.actions.MoveWay = function(wayId, delta, projection) {
return function(graph) {
var way = graph.entity(wayId);
_.uniq(way.nodes).forEach(function(id) {
var node = graph.entity(id),
start = projection(node.loc),
end = projection.invert([start[0] + delta[0], start[1] + delta[1]]);
graph = iD.actions.MoveNode(id, end)(graph);
});
return graph;
};
};