UX: add link to Mapillary, fix #1637

This commit is contained in:
Pieter Vander Vennet 2023-12-02 03:12:34 +01:00
parent c7089c27a0
commit 804005e402
12 changed files with 82 additions and 37 deletions

View file

@ -6,13 +6,14 @@ import { Utils } from "../../Utils"
export interface ProvidedImage {
url: string
key: string
provider: ImageProvider
provider: ImageProvider,
id: string
}
export default abstract class ImageProvider {
public abstract readonly defaultKeyPrefixes: string[]
public abstract SourceIcon(backlinkSource?: string): 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
@ -28,7 +29,7 @@ export default abstract class ImageProvider {
throw "No `defaultKeyPrefixes` defined by this image provider"
}
const relevantUrls = new UIEventSource<
{ url: string; key: string; provider: ImageProvider }[]
{ id: string, url: string; key: string; provider: ImageProvider }[]
>([])
const seenValues = new Set<string>()
allTags.addCallbackAndRunD((tags) => {
@ -67,4 +68,10 @@ export default abstract class ImageProvider {
public abstract DownloadAttribution(url: string): Promise<LicenseInfo>
public abstract apiUrls(): string[]
public backlink(): string | undefined {
return undefined
}
}