From 9827f07433787370c9238e324bff3c5381af8fba Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 28 Apr 2024 01:08:28 +0200 Subject: [PATCH] Custom themes: fix loading of external images in iconBadges, see #1927 --- src/Models/ThemeConfig/PointRenderingConfig.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Models/ThemeConfig/PointRenderingConfig.ts b/src/Models/ThemeConfig/PointRenderingConfig.ts index 25526643fe..403cdcbc36 100644 --- a/src/Models/ThemeConfig/PointRenderingConfig.ts +++ b/src/Models/ThemeConfig/PointRenderingConfig.ts @@ -12,6 +12,8 @@ import { VariableUiElement } from "../../UI/Base/VariableUIElement" import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson" import SvelteUIElement from "../../UI/Base/SvelteUIElement" import DynamicMarker from "../../UI/Map/DynamicMarker.svelte" +import { UIElement } from "../../UI/UIElement" +import Img from "../../UI/Base/Img" export class IconConfig extends WithContextLoader { public static readonly defaultIcon = new IconConfig({ icon: "pin", color: "#ff9939" }) @@ -121,9 +123,14 @@ export default class PointRenderingConfig extends WithContextLoader { context + ".rotationAlignment" ) } - private static FromHtmlMulti(multiSpec: string, tags: Store>) { + private static FromHtmlMulti(multiSpec: string, tags: Store>): BaseUIElement { const icons: IconConfig[] = [] + for (const subspec of multiSpec.split(";")) { + if(subspec.startsWith("http://") || subspec.startsWith("https://")){ + icons.push(new IconConfig({icon: subspec})) + continue + } const [icon, color] = subspec.split(":") icons.push(new IconConfig({ icon, color })) }