forked from MapComplete/MapComplete
Feature: load HD-images from mapillary in preview
This commit is contained in:
parent
1748e98bfc
commit
09993c2e44
3 changed files with 31 additions and 18 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue