MapComplete/src/UI/Map/StyleLoadingIndicator.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
442 B
Svelte
Raw Normal View History

2024-02-21 17:33:29 +01:00
<script lang="ts">
import Loading from "../Base/Loading.svelte"
import { Stores, UIEventSource } from "../../Logic/UIEventSource"
import { Map as MlMap } from "maplibre-gl"
import { onDestroy } from "svelte"
let isLoading = false
export let map: UIEventSource<MlMap>
onDestroy(Stores.Chronic(250).addCallback(
() => {
isLoading = !map.data?.isStyleLoaded()
},
))
</script>
{#if isLoading}
<Loading />
{/if}