forked from MapComplete/MapComplete
Feature: add zoomable image when clicked
This commit is contained in:
parent
c65ccdbc24
commit
d7413e8228
20 changed files with 481 additions and 181 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,6 @@ export class LicenseInfo {
|
|||
credit: string = ""
|
||||
description: string = ""
|
||||
informationLocation: URL = undefined
|
||||
date?: Date
|
||||
views?: number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue