prevent dragging existing, prevent deleting existing

This commit is contained in:
Will Freeman
2025-06-12 15:11:44 -06:00
parent 2640b3059b
commit cde95195a1
4 changed files with 17 additions and 6 deletions
+5
View File
@@ -7,6 +7,11 @@ export function actionDeleteNode(nodeId) {
var action = function(graph) {
var node = graph.entity(nodeId);
// Prevent deletion of existing nodes (anti-vandalism)
if (node.version) {
throw new Error('Deletion of existing features is not allowed.');
}
graph.parentWays(node)
.forEach(function(parent) {
parent = parent.removeNode(nodeId);