forked from MapComplete/MapComplete
Refactoring: move 'GetDefaultIcon' into its own Svelte-class
This commit is contained in:
parent
f6ed163554
commit
28f9532af9
13 changed files with 97 additions and 80 deletions
27
src/UI/Map/DefaultIcon.svelte
Normal file
27
src/UI/Map/DefaultIcon.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
|
||||
|
||||
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
||||
import DynamicIcon from "./DynamicIcon.svelte"
|
||||
import DynamicMarker from "./DynamicMarker.svelte"
|
||||
import Marker from "./Marker.svelte"
|
||||
import { ImmutableStore } from "../../Logic/UIEventSource"
|
||||
|
||||
/**
|
||||
* The 'DefaultIcon' is the icon that a layer shows by default
|
||||
* Used e.g. in the filterview
|
||||
*/
|
||||
export let layer: LayerConfig
|
||||
export let properties: Readonly<Record<string, string>> = layer.baseTags
|
||||
export let clss= ""
|
||||
let tags = new ImmutableStore(properties)
|
||||
let mapRenderings = layer.mapRendering?.filter((r) => r.location.has("point"))
|
||||
</script>
|
||||
|
||||
{#if mapRenderings?.length > 0}
|
||||
<div class={"relative block w-full h-full "+clss}>
|
||||
{#each mapRenderings as mr}
|
||||
<DynamicMarker marker={mr.marker} rotation={mr.rotation} {tags} />
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
Loading…
Add table
Add a link
Reference in a new issue