mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-19 12:13:43 +00:00
11 lines
472 B
JavaScript
11 lines
472 B
JavaScript
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/AddNodeToWayAction.as
|
|
iD.actions.AddWayNode = function(wayId, nodeId, index) {
|
|
return function(graph) {
|
|
var way = graph.entity(wayId),
|
|
node = graph.entity(nodeId),
|
|
nodes = way.nodes.slice();
|
|
nodes.splice((index === undefined) ? nodes.length : index, 0, nodeId);
|
|
return graph.replace(way.update({nodes: nodes}));
|
|
};
|
|
};
|