Add style loading indicator, fix #1626

This commit is contained in:
Pieter Vander Vennet 2024-02-21 17:33:29 +01:00
parent 1f9cab7134
commit 57a6677149
3 changed files with 28 additions and 3 deletions

View file

@ -0,0 +1,19 @@
<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}