2023-09-16 02:30:01 +02:00
|
|
|
<script lang="ts">
|
2023-12-19 22:08:00 +01:00
|
|
|
import { Store } from "../../Logic/UIEventSource"
|
|
|
|
import type { OsmTags } from "../../Models/OsmFeature"
|
|
|
|
import type { SpecialVisualizationState } from "../SpecialVisualization"
|
|
|
|
import type { Feature } from "geojson"
|
|
|
|
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
|
|
|
import Translations from "../i18n/Translations"
|
|
|
|
import Tr from "../Base/Tr.svelte"
|
|
|
|
import NearbyImages from "./NearbyImages.svelte"
|
|
|
|
import { XCircleIcon } from "@babeard/svelte-heroicons/solid"
|
|
|
|
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
|
|
|
|
import LoginToggle from "../Base/LoginToggle.svelte"
|
2023-12-15 01:46:01 +01:00
|
|
|
import { ariaLabel } from "../../Utils/ariaLabel"
|
2023-09-16 02:30:01 +02:00
|
|
|
|
2023-12-19 22:08:00 +01:00
|
|
|
export let tags: Store<OsmTags>
|
|
|
|
export let state: SpecialVisualizationState
|
|
|
|
export let lon: number
|
|
|
|
export let lat: number
|
|
|
|
export let feature: Feature
|
2023-09-16 02:30:01 +02:00
|
|
|
|
2023-12-19 22:08:00 +01:00
|
|
|
export let linkable: boolean = true
|
|
|
|
export let layer: LayerConfig
|
|
|
|
const t = Translations.t.image.nearby
|
2023-09-16 02:30:01 +02:00
|
|
|
|
2023-12-19 22:08:00 +01:00
|
|
|
let expanded = false
|
2023-09-16 02:30:01 +02:00
|
|
|
</script>
|
2023-12-06 17:27:30 +01:00
|
|
|
|
2023-12-19 22:08:00 +01:00
|
|
|
<LoginToggle {state}>
|
2023-12-06 17:27:30 +01:00
|
|
|
{#if expanded}
|
2023-12-15 01:46:01 +01:00
|
|
|
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable} {layer}>
|
2023-12-21 01:46:18 +01:00
|
|
|
<button
|
|
|
|
slot="corner"
|
|
|
|
class="no-image-background h-6 w-6 cursor-pointer border-none p-0"
|
|
|
|
use:ariaLabel={t.close}
|
|
|
|
on:click={() => {
|
|
|
|
expanded = false
|
|
|
|
}}
|
|
|
|
>
|
2023-12-06 17:27:30 +01:00
|
|
|
<XCircleIcon />
|
|
|
|
</button>
|
|
|
|
</NearbyImages>
|
|
|
|
{:else}
|
|
|
|
<button
|
|
|
|
class="flex w-full items-center"
|
|
|
|
on:click={() => {
|
2023-12-21 01:46:18 +01:00
|
|
|
expanded = true
|
|
|
|
}}
|
2023-12-12 19:18:50 +01:00
|
|
|
aria-expanded={expanded}
|
2023-12-06 17:27:30 +01:00
|
|
|
>
|
|
|
|
<Camera_plus class="mr-2 block h-8 w-8 p-1" />
|
|
|
|
<Tr t={t.seeNearby} />
|
|
|
|
</button>
|
|
|
|
{/if}
|
2023-12-04 15:02:42 +01:00
|
|
|
</LoginToggle>
|