Feature: add zoomable image when clicked

This commit is contained in:
Pieter Vander Vennet 2023-12-05 18:35:18 +01:00
parent c65ccdbc24
commit d7413e8228
20 changed files with 481 additions and 181 deletions

View file

@ -94,6 +94,8 @@ export class Imgur extends ImageProvider implements ImageUploader {
const descr: string = response.data.description ?? ""
const data: any = {}
const imgurData = response.data
for (const tag of descr.split("\n")) {
const kv = tag.split(":")
const k = kv[0]
@ -104,6 +106,8 @@ export class Imgur extends ImageProvider implements ImageUploader {
licenseInfo.licenseShortName = data.license
licenseInfo.artist = data.author
licenseInfo.date = new Date(Number(imgurData.datetime) * 1000)
licenseInfo.views = imgurData.views
return licenseInfo
}

View file

@ -9,4 +9,6 @@ export class LicenseInfo {
credit: string = ""
description: string = ""
informationLocation: URL = undefined
date?: Date
views?: number
}

View file

@ -60,8 +60,8 @@ export class Mapillary extends ImageProvider {
} = undefined, zoom: number = 17, pKey?: string) {
const params = {
focus: pKey === undefined ? "map" : "photo",
lat: location.lat,
lng: location.lon,
lat: location?.lat,
lng: location?.lon,
z: location === undefined ? undefined : Math.max((zoom ?? 2) - 1, 1),
pKey,
}