Feature: load HD-images from mapillary in preview

This commit is contained in:
Pieter Vander Vennet 2023-12-07 01:04:43 +01:00
parent 1748e98bfc
commit 09993c2e44
3 changed files with 31 additions and 18 deletions

View file

@ -5,15 +5,16 @@ import { Utils } from "../../Utils"
export interface ProvidedImage {
url: string
url_hd?: string
key: string
provider: ImageProvider,
provider: ImageProvider
id: string
}
export default abstract class ImageProvider {
public abstract readonly defaultKeyPrefixes: string[]
public abstract SourceIcon(id?: string, location?: {lon: number, lat: number}): BaseUIElement
public abstract SourceIcon(id?: string, location?: { lon: number; lat: number }): BaseUIElement
/**
* Given a properies object, maps it onto _all_ the available pictures for this imageProvider
@ -29,7 +30,7 @@ export default abstract class ImageProvider {
throw "No `defaultKeyPrefixes` defined by this image provider"
}
const relevantUrls = new UIEventSource<
{ id: string, url: string; key: string; provider: ImageProvider }[]
{ id: string; url: string; key: string; provider: ImageProvider }[]
>([])
const seenValues = new Set<string>()
allTags.addCallbackAndRunD((tags) => {
@ -72,6 +73,4 @@ export default abstract class ImageProvider {
public backlink(): string | undefined {
return undefined
}
}