forked from MapComplete/MapComplete
Themes: fix conversion for legacy themes
This commit is contained in:
parent
4634ca27ae
commit
21c35fc2c5
2 changed files with 11 additions and 10 deletions
|
@ -168,8 +168,18 @@ export class UpdateLegacyLayer extends DesugaringStep<
|
|||
const pr = rendering
|
||||
if (pr["icon"]) {
|
||||
try {
|
||||
const icon = Utils.NoEmpty(pr["icon"].split(";"))
|
||||
let iconConfig = pr["icon"]
|
||||
if (
|
||||
Object.keys(iconConfig).length === 1 &&
|
||||
iconConfig["render"] !== undefined
|
||||
) {
|
||||
iconConfig = iconConfig.render
|
||||
}
|
||||
const icon = Utils.NoEmpty(iconConfig.split(";"))
|
||||
pr.marker = icon.map((i) => {
|
||||
if (i.startsWith("http")) {
|
||||
return { icon: i }
|
||||
}
|
||||
const [iconPath, color] = i.split(":")
|
||||
return { icon: iconPath, color }
|
||||
})
|
||||
|
@ -243,10 +253,6 @@ class UpdateLegacyTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
delete oldThemeConfig.socialImage
|
||||
}
|
||||
|
||||
if (oldThemeConfig.defaultBackgroundId === "osm") {
|
||||
console.log("Removing old background in", json.id)
|
||||
}
|
||||
|
||||
if (typeof oldThemeConfig.credits === "string") {
|
||||
oldThemeConfig.credits = [oldThemeConfig.credits]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue