Refactoring: further cleanup of the themes

This commit is contained in:
Pieter Vander Vennet 2023-06-20 03:14:18 +02:00
parent 2f5091a8cb
commit e86f7d863e
86 changed files with 230 additions and 579 deletions

View file

@ -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: [],