forked from MapComplete/MapComplete
Refactoring: add metatagging, add 'last edited by' element, add 'metacondition'
This commit is contained in:
parent
771783a31c
commit
105120060d
31 changed files with 217 additions and 142 deletions
|
@ -96,16 +96,11 @@ export class ReferencingWaysMetaTagger extends SimpleMetaTagger {
|
|||
return false
|
||||
}
|
||||
|
||||
console.trace("Downloading referencing ways for", feature.properties.id)
|
||||
OsmObject.DownloadReferencingWays(id).then((referencingWays) => {
|
||||
const currentTagsSource = state.allElements?.getEventSourceById(id) ?? []
|
||||
Utils.AddLazyPropertyAsync(feature.properties, "_referencing_ways", async () => {
|
||||
const referencingWays = await OsmObject.DownloadReferencingWays(id)
|
||||
const wayIds = referencingWays.map((w) => "way/" + w.id)
|
||||
wayIds.sort()
|
||||
const wayIdsStr = wayIds.join(";")
|
||||
if (wayIdsStr !== "" && currentTagsSource.data["_referencing_ways"] !== wayIdsStr) {
|
||||
currentTagsSource.data["_referencing_ways"] = wayIdsStr
|
||||
currentTagsSource.ping()
|
||||
}
|
||||
return wayIds.join(";")
|
||||
})
|
||||
|
||||
return true
|
||||
|
@ -221,6 +216,7 @@ class RewriteMetaInfoTags extends SimpleMetaTagger {
|
|||
return movedSomething
|
||||
}
|
||||
}
|
||||
|
||||
export default class SimpleMetaTaggers {
|
||||
/**
|
||||
* A simple metatagger which rewrites various metatags as needed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue