forked from MapComplete/MapComplete
UX: translate 'creating point', indicate that a new background layer is loading in the selectBackgroundButton
This commit is contained in:
parent
dcc4a98344
commit
7210b3ff5d
8 changed files with 41 additions and 10 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue