forked from MapComplete/MapComplete
Refactoring: further cleanup of the themes
This commit is contained in:
parent
2f5091a8cb
commit
e86f7d863e
86 changed files with 230 additions and 579 deletions
|
@ -147,13 +147,25 @@ export class UpdateLegacyLayer extends DesugaringStep<
|
|||
const pr = <PointRenderingConfigJson>rendering
|
||||
const iconSize = pr.iconSize
|
||||
if (typeof iconSize === "string")
|
||||
if (["bottom", "center", "top"].some((a) => (<string>iconSize).endsWith("," + a))) {
|
||||
if (["bottom", "center", "top"].some((a) => (<string>iconSize).endsWith(a))) {
|
||||
const parts = iconSize.split(",").map((parts) => parts.toLowerCase().trim())
|
||||
pr.anchor = parts.pop()
|
||||
pr.iconSize = parts.join(",")
|
||||
}
|
||||
}
|
||||
|
||||
for (const rendering of config.mapRendering) {
|
||||
for (const key in rendering) {
|
||||
if (
|
||||
typeof rendering[key]["render"] === "string" &&
|
||||
Object.keys(rendering[key]).length === 1
|
||||
) {
|
||||
console.log("Rewrite: ", rendering[key])
|
||||
rendering[key] = rendering[key]["render"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
result: config,
|
||||
errors: [],
|
||||
|
|
|
@ -32,6 +32,12 @@ export default class WithContextLoader {
|
|||
return shared
|
||||
}
|
||||
}
|
||||
if (Object.keys(v).length === 1 && typeof v["render"] === "string") {
|
||||
throw `At ${
|
||||
translationContext ?? "<unknown>"
|
||||
}: use the content directly instead of {${key}: ${JSON.stringify(v)}}`
|
||||
}
|
||||
|
||||
return new TagRenderingConfig(v, `${translationContext ?? this._context}.${key}`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue