2023-06-07 22:45:42 +02:00
|
|
|
<script lang="ts">
|
2023-06-14 23:58:57 +02:00
|
|
|
/**
|
|
|
|
* A mapcontrol button which allows the user to select a different background.
|
2024-03-12 03:40:55 +01:00
|
|
|
* Even though the component is very small, it gets its own class as it is often reused
|
2023-06-14 23:58:57 +02:00
|
|
|
*/
|
2023-06-15 16:12:46 +02:00
|
|
|
import { Square3Stack3dIcon } from "@babeard/svelte-heroicons/solid"
|
|
|
|
import type { SpecialVisualizationState } from "../SpecialVisualization"
|
|
|
|
import Translations from "../i18n/Translations"
|
|
|
|
import MapControlButton from "../Base/MapControlButton.svelte"
|
|
|
|
import Tr from "../Base/Tr.svelte"
|
2024-03-12 03:40:55 +01:00
|
|
|
import StyleLoadingIndicator from "../Map/StyleLoadingIndicator.svelte"
|
2024-03-27 00:25:42 +01:00
|
|
|
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
2024-03-12 03:40:55 +01:00
|
|
|
import { Map as MlMap } from "maplibre-gl"
|
|
|
|
import ThemeViewState from "../../Models/ThemeViewState"
|
2023-06-07 22:45:42 +02:00
|
|
|
|
2024-03-12 03:40:55 +01:00
|
|
|
export let state: ThemeViewState
|
2024-03-27 00:25:42 +01:00
|
|
|
export let map: Store<MlMap> = undefined
|
2023-06-14 23:58:57 +02:00
|
|
|
export let hideTooltip = false
|
2023-06-07 22:45:42 +02:00
|
|
|
</script>
|
|
|
|
|
2023-12-21 01:46:18 +01:00
|
|
|
<MapControlButton
|
|
|
|
arialabel={Translations.t.general.labels.background}
|
|
|
|
on:click={() => state.guistate.backgroundLayerSelectionIsOpened.setData(true)}
|
|
|
|
>
|
2024-03-12 03:40:55 +01:00
|
|
|
|
2024-03-27 00:25:42 +01:00
|
|
|
<StyleLoadingIndicator map={map ?? state.map} rasterLayer={state.mapProperties.rasterLayer} >
|
2024-03-12 03:40:55 +01:00
|
|
|
<Square3Stack3dIcon class="h-6 w-6" />
|
|
|
|
</StyleLoadingIndicator>
|
2023-06-14 23:58:57 +02:00
|
|
|
{#if !hideTooltip}
|
2023-06-15 16:12:46 +02:00
|
|
|
<Tr cls="mx-2" t={Translations.t.general.backgroundSwitch} />
|
2023-06-14 23:58:57 +02:00
|
|
|
{/if}
|
2023-06-07 22:45:42 +02:00
|
|
|
</MapControlButton>
|