forked from MapComplete/MapComplete
Properly render theme icon when using a studio layer as theme
This commit is contained in:
parent
5ead6c6e37
commit
d38a6c7505
6 changed files with 50 additions and 27 deletions
|
|
@ -5,11 +5,30 @@
|
|||
/**
|
||||
* Renders a 'marker', which consists of multiple 'icons'
|
||||
*/
|
||||
export let icons: { icon: string; color: string }[]
|
||||
export let icons: string | { icon: string; color: string }[]
|
||||
|
||||
if(typeof icons === "string") {
|
||||
icons = icons.split(";").map(subspec => {
|
||||
if(subspec.startsWith("http://") || subspec.startsWith("https://")){
|
||||
return {
|
||||
icon: subspec, color: "black"
|
||||
}
|
||||
}
|
||||
const [icon, color] = subspec.split(":")
|
||||
return {
|
||||
icon, color: color ?? "black"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Class which is applied onto the individual icons
|
||||
*/
|
||||
export let clss = ""
|
||||
|
||||
/**
|
||||
* Class applied onto the entire element
|
||||
*/
|
||||
export let size = "w-full h-full"
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue