UX: translate 'creating point', indicate that a new background layer is loading in the selectBackgroundButton

This commit is contained in:
Pieter Vander Vennet 2024-03-12 03:40:55 +01:00
parent dcc4a98344
commit 7210b3ff5d
8 changed files with 41 additions and 10 deletions

View file

@ -6,14 +6,26 @@
let isLoading = false
export let map: UIEventSource<MlMap>
export let rasterLayer: UIEventSource<any> = undefined
let didChange = undefined
onDestroy(rasterLayer?.addCallback(() => {
didChange = true
}) ??( () => {}))
onDestroy(Stores.Chronic(250).addCallback(
() => {
isLoading = !map.data?.isStyleLoaded()
isLoading = !map.data?.isStyleLoaded() && (didChange === undefined || didChange)
if(didChange){
didChange = false
}
},
))
</script>
{#if isLoading}
<Loading />
<Loading cls="h-6 w-6" />
{:else}
<slot />
{/if}