MapComplete/src/UI/BigComponents/Summary.svelte

25 lines
997 B
Svelte
Raw Normal View History

<script lang="ts">
2023-11-23 15:47:16 +01:00
import type { Feature } from "geojson"
import type { SpecialVisualizationState } from "../SpecialVisualization"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import TagRenderingAnswer from "../Popup/TagRendering/TagRenderingAnswer.svelte"
2023-12-21 17:36:43 +01:00
import DirectionIndicator from "../Base/DirectionIndicator.svelte"
2023-11-23 15:47:16 +01:00
export let state: SpecialVisualizationState
export let feature: Feature
export let i: number = undefined
let id = feature.properties.id
2023-11-23 15:47:16 +01:00
let tags = state.featureProperties.getStore(id)
let layer: LayerConfig = state.layout.getMatchingLayer(tags.data)
</script>
2023-12-21 17:36:43 +01:00
<a class="small flex space-x-1 cursor-pointer w-fit" href={`#${feature.properties.id}`}>
{#if i !== undefined}
<span class="font-bold">{i + 1} &nbsp; </span>
{/if}
<TagRenderingAnswer config={layer.title} extraClasses="inline-flex w-fit" {layer} selectedElement={feature} {state}
{tags} />
<DirectionIndicator {feature} {state} />
</a>