forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
f77570589d
commit
9b8a9337fd
111 changed files with 2911 additions and 1280 deletions
|
@ -17,11 +17,11 @@
|
|||
export let highlightedRendering: UIEventSource<string> = undefined
|
||||
|
||||
export let tags: UIEventSource<Record<string, string>> = state?.featureProperties?.getStore(
|
||||
selectedElement.properties.id,
|
||||
selectedElement.properties.id
|
||||
)
|
||||
|
||||
let isAddNew = tags.mapD(
|
||||
(t) => t?.id?.startsWith(LastClickFeatureSource.newPointElementId) ?? false,
|
||||
(t) => t?.id?.startsWith(LastClickFeatureSource.newPointElementId) ?? false
|
||||
)
|
||||
|
||||
export let layer: LayerConfig
|
||||
|
@ -32,29 +32,32 @@
|
|||
onDestroy(
|
||||
state.userRelatedState.preferencesAsTags.addCallbackAndRun((tags) => {
|
||||
_metatags = tags
|
||||
}),
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
let knownTagRenderings: Store<TagRenderingConfig[]> = tags.mapD((tgs) =>
|
||||
layer?.tagRenderings?.filter(
|
||||
(config) => {
|
||||
if (mustMatchLabels !== undefined) {
|
||||
if (!mustMatchLabels.has(config.id) && !config?.labels?.some(l => mustMatchLabels.has(l))) {
|
||||
return false
|
||||
}
|
||||
} else if (dontMatchLabels) {
|
||||
if (dontMatchLabels.has(config.id) || config?.labels?.some(l => dontMatchLabels.has(l))) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (!config.IsKnown(tgs)) {
|
||||
layer?.tagRenderings?.filter((config) => {
|
||||
if (mustMatchLabels !== undefined) {
|
||||
if (
|
||||
!mustMatchLabels.has(config.id) &&
|
||||
!config?.labels?.some((l) => mustMatchLabels.has(l))
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return (config.condition?.matchesProperties(tgs) ?? true) &&
|
||||
(config.metacondition?.matchesProperties({ ...tgs, ..._metatags }) ?? true)
|
||||
},
|
||||
),
|
||||
} else if (dontMatchLabels) {
|
||||
if (dontMatchLabels.has(config.id) || config?.labels?.some((l) => dontMatchLabels.has(l))) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (!config.IsKnown(tgs)) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
(config.condition?.matchesProperties(tgs) ?? true) &&
|
||||
(config.metacondition?.matchesProperties({ ...tgs, ..._metatags }) ?? true)
|
||||
)
|
||||
})
|
||||
)
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue