From 3c7d63273942f83290a119b6af5419a7e1c42e20 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 29 Jan 2023 13:31:49 +0100 Subject: [PATCH] Fix #1280 --- Logic/SimpleMetaTagger.ts | 3 ++- UI/BigComponents/SimpleAddUI.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Logic/SimpleMetaTagger.ts b/Logic/SimpleMetaTagger.ts index 5a978f7bd6..dd19965246 100644 --- a/Logic/SimpleMetaTagger.ts +++ b/Logic/SimpleMetaTagger.ts @@ -490,9 +490,10 @@ export default class SimpleMetaTaggers { { keys: ["_referencing_ways"], isLazy: true, - doc: "_referencing_ways contains - for a node - which ways use this this node as point in their geometry.", + doc: "_referencing_ways contains - for a node - which ways use this this node as point in their geometry. ", }, (feature, _, __, state) => { + //this function has some extra code to make it work in SimpleAddUI.ts to also work for newly added points const id = feature.properties.id if (!id.startsWith("node/")) { return false diff --git a/UI/BigComponents/SimpleAddUI.ts b/UI/BigComponents/SimpleAddUI.ts index b9dbcbb5b1..2cebb2512e 100644 --- a/UI/BigComponents/SimpleAddUI.ts +++ b/UI/BigComponents/SimpleAddUI.ts @@ -101,6 +101,9 @@ export default class SimpleAddUI extends LoginToggle { snapOntoWay?: OsmWay ): Promise { tags.push(new Tag(Tag.newlyCreated.key, new Date().toISOString())) + if (snapOntoWay) { + tags.push(new Tag("_referencing_ways", "way/" + snapOntoWay.id)) + } const newElementAction = new CreateNewNodeAction(tags, location.lat, location.lon, { theme: state.layoutToUse?.id ?? "unkown", changeType: "create",