forked from MapComplete/MapComplete
Refactoring: image providers use ID everywhere
This commit is contained in:
parent
d9c1fe3f74
commit
1ddfffcee0
6 changed files with 19 additions and 20 deletions
|
@ -124,8 +124,7 @@ export default abstract class ImageProvider {
|
|||
): undefined | ProvidedImage[] | Promise<ProvidedImage[]>
|
||||
|
||||
public abstract DownloadAttribution(providedImage: {
|
||||
url: string
|
||||
id?: string
|
||||
id: string
|
||||
}): Promise<LicenseInfo>
|
||||
|
||||
public abstract apiUrls(): string[]
|
||||
|
@ -142,7 +141,7 @@ export default abstract class ImageProvider {
|
|||
id: string
|
||||
}): Promise<Feature<Point, PanoramaView>> | undefined
|
||||
|
||||
public static async offerImageAsDownload(image: ProvidedImage) {
|
||||
public static async offerImageAsDownload(image: { url_hd?: string, url: string }) {
|
||||
const response = await fetch(image.url_hd ?? image.url)
|
||||
const blob = await response.blob()
|
||||
Utils.offerContentsAsDownloadableFile(blob, new URL(image.url).pathname.split("/").at(-1), {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue