forked from MapComplete/MapComplete
Fix: actually show HD image for nearby streetview imager, add loading indicator
This commit is contained in:
parent
6d8f1525b0
commit
8b6ee877f0
3 changed files with 16 additions and 3 deletions
|
@ -4,10 +4,12 @@
|
|||
*/
|
||||
import panzoom from "panzoom"
|
||||
import type { ProvidedImage } from "../../Logic/ImageProviders/ImageProvider"
|
||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
||||
|
||||
export let image: ProvidedImage
|
||||
let panzoomInstance = undefined
|
||||
let panzoomEl: HTMLElement
|
||||
export let isLoaded: UIEventSource<boolean> = undefined
|
||||
|
||||
$: {
|
||||
if (panzoomEl) {
|
||||
|
@ -16,7 +18,7 @@
|
|||
boundsPadding: 0.49,
|
||||
minZoom: 1,
|
||||
maxZoom: 25,
|
||||
initialZoom: 1.2,
|
||||
initialZoom: 1.0,
|
||||
})
|
||||
} else {
|
||||
panzoomInstance?.dispose()
|
||||
|
@ -24,4 +26,5 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<img bind:this={panzoomEl} src={image.url_hd ?? image.url} class="panzoom-image h-fit w-fit" />
|
||||
<img bind:this={panzoomEl} class="panzoom-image h-fit w-fit" on:load={() => {isLoaded?.setData(true)}}
|
||||
src={image.url_hd ?? image.url} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue