2023-09-16 02:30:01 +02:00
|
|
|
<script lang="ts">
|
2023-12-06 17:27:30 +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-09-16 02:30:01 +02:00
|
|
|
|
2023-12-06 17:27:30 +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-06 17:27:30 +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-06 17:27:30 +01:00
|
|
|
let expanded = false;
|
2023-09-16 02:30:01 +02:00
|
|
|
</script>
|
2023-12-04 15:02:42 +01:00
|
|
|
<LoginToggle {state}>
|
2023-12-06 17:27:30 +01:00
|
|
|
|
|
|
|
{#if expanded}
|
|
|
|
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable}>
|
|
|
|
<button slot="corner"
|
|
|
|
class="h-6 w-6 cursor-pointer no-image-background p-0 border-none"
|
|
|
|
on:click={() => {
|
2023-09-21 15:29:34 +02:00
|
|
|
expanded = false
|
2023-12-06 17:27:30 +01:00
|
|
|
}}>
|
|
|
|
<XCircleIcon />
|
|
|
|
</button>
|
|
|
|
</NearbyImages>
|
|
|
|
{:else}
|
|
|
|
<button
|
|
|
|
class="flex w-full items-center"
|
|
|
|
on:click={() => {
|
2023-09-21 15:29:34 +02: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>
|