UI: fix rendering of icons in addNewPoint, fix #1722

This commit is contained in:
Pieter Vander Vennet 2024-02-02 13:55:05 +01:00
parent 872e36dffa
commit ef3eb4fcd0
3 changed files with 18 additions and 13 deletions

View file

@ -79,7 +79,6 @@ export default class PointRenderingConfig extends WithContextLoader {
}
})
this.marker = (json.marker ?? []).map((m) => new IconConfig(<any>m))
if (json.css !== undefined) {
this.cssDef = this.tr("css", undefined)
@ -199,13 +198,14 @@ export default class PointRenderingConfig extends WithContextLoader {
if (options?.noSize) {
iconAndBadges.SetClass("w-full h-full")
} else {
tags.map((tags) => this.iconSize.GetRenderValue(tags).Subs(tags).txt ?? "[40,40]").map(
(size) => {
const [iconW, iconH] = size.split(",").map((x) => num(x))
iconAndBadges.SetStyle(`width: ${iconW}px; height: ${iconH}px`)
}
)
}
tags.map((tags) => this.iconSize.GetRenderValue(tags).Subs(tags).txt ?? "[40,40]").map(
(size) => {
const [iconW, iconH] = size.split(",").map((x) => num(x))
iconAndBadges.SetStyle(`width: ${iconW}px; height: ${iconH}px`)
}
)
const css = this.cssDef?.GetRenderValue(tags.data)?.txt
const cssClasses = this.cssClasses?.GetRenderValue(tags.data)?.txt