forked from MapComplete/MapComplete
Fix #1280
This commit is contained in:
parent
1d11cbcf3b
commit
3c7d632739
2 changed files with 5 additions and 1 deletions
|
@ -490,9 +490,10 @@ export default class SimpleMetaTaggers {
|
||||||
{
|
{
|
||||||
keys: ["_referencing_ways"],
|
keys: ["_referencing_ways"],
|
||||||
isLazy: true,
|
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) => {
|
(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
|
const id = feature.properties.id
|
||||||
if (!id.startsWith("node/")) {
|
if (!id.startsWith("node/")) {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -101,6 +101,9 @@ export default class SimpleAddUI extends LoginToggle {
|
||||||
snapOntoWay?: OsmWay
|
snapOntoWay?: OsmWay
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
tags.push(new Tag(Tag.newlyCreated.key, new Date().toISOString()))
|
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, {
|
const newElementAction = new CreateNewNodeAction(tags, location.lat, location.lon, {
|
||||||
theme: state.layoutToUse?.id ?? "unkown",
|
theme: state.layoutToUse?.id ?? "unkown",
|
||||||
changeType: "create",
|
changeType: "create",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue