From a5690fa55605879444bcd83d57850c6d356b7907 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 19 Jun 2024 03:26:29 +0200 Subject: [PATCH] Fix loading of mapping-icons --- src/UI/Map/Marker.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/UI/Map/Marker.svelte b/src/UI/Map/Marker.svelte index 1e76758b6..477ad9620 100644 --- a/src/UI/Map/Marker.svelte +++ b/src/UI/Map/Marker.svelte @@ -7,8 +7,9 @@ */ export let icons: string | { icon: string; color: string }[] + let iconsParsed: { icon: string; color: string }[] if(typeof icons === "string") { - icons = icons.split(";").map(subspec => { + iconsParsed = icons.split(";").map(subspec => { if(subspec.startsWith("http://") || subspec.startsWith("https://")){ return { icon: subspec, color: "black" @@ -19,6 +20,8 @@ icon, color: color ?? "black" } }) + }else{ + iconsParsed = icons } /** @@ -32,9 +35,9 @@ export let size = "w-full h-full" -{#if icons !== undefined && icons.length > 0} +{#if iconsParsed !== undefined && iconsParsed.length > 0}
- {#each icons as icon} + {#each iconsParsed as icon}