forked from MapComplete/MapComplete
Themes: automatically derive source from presets if no source is given
This commit is contained in:
parent
662b5d0735
commit
06897588be
6 changed files with 243 additions and 184 deletions
|
@ -81,15 +81,16 @@ class ParseLayer extends Conversion<
|
|||
}
|
||||
const fixed = this._prepareLayer.convert(parsed, context.inOperation("PrepareLayer"))
|
||||
|
||||
if (!fixed.source) {
|
||||
context.enter("source").err("No source is configured")
|
||||
if (!fixed.source && fixed.presets?.length < 1) {
|
||||
context.enter("source").err("No source is configured. (Tags might be automatically derived if presets are given)")
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (
|
||||
fixed.source &&
|
||||
typeof fixed.source !== "string" &&
|
||||
fixed.source["osmTags"] &&
|
||||
fixed.source["osmTags"]["and"] === undefined
|
||||
fixed.source?.["osmTags"] &&
|
||||
fixed.source?.["osmTags"]["and"] === undefined
|
||||
) {
|
||||
fixed.source["osmTags"] = { and: [fixed.source["osmTags"]] }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue