Feat: upload to specified panoramax instance

This commit is contained in:
Pieter Vander Vennet 2024-10-23 02:04:28 +02:00
parent 35b4943948
commit 3df0f9ca94
3 changed files with 5 additions and 4 deletions

View file

@ -42,7 +42,8 @@
}, },
"panoramax": { "panoramax": {
"url": "https://panoramax.mapcomplete.org", "url": "https://panoramax.mapcomplete.org",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnZW92aXNpbyIsInN1YiI6IjU5ZjgzOGI0LTM4ZjAtNDdjYi04OWYyLTM3NDQ3MWMxNTUxOCJ9.0rBioZS_48NTjnkIyN9497c3fQdTqtGgH1HDqlz1bWs" "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnZW92aXNpbyIsInN1YiI6IjU5ZjgzOGI0LTM4ZjAtNDdjYi04OWYyLTM3NDQ3MWMxNTUxOCJ9.0rBioZS_48NTjnkIyN9497c3fQdTqtGgH1HDqlz1bWs",
"sequence": "6e702976-580b-419c-8fb3-cf7bd364e6f8"
}, },
"default_overpass_urls": [ "default_overpass_urls": [
"https://overpass-api.de/api/interpreter", "https://overpass-api.de/api/interpreter",

View file

@ -204,10 +204,10 @@ export class PanoramaxUploader implements ImageUploader {
console.error("Could not read EXIF-tags") console.error("Could not read EXIF-tags")
} }
let [lon, lat] = currentGps const [lon, lat] = currentGps
const p = this._panoramax const p = this._panoramax
const defaultSequence = (await p.mySequences())[0] const defaultSequence = (await p.mySequences()).find(s => s.id === Constants.panoramax.sequence)
const img = <ImageData>await p.addImage(blob, defaultSequence, { const img = <ImageData>await p.addImage(blob, defaultSequence, {
// It might seem odd that we set 'undefined' here - keep in mind that, by default, panoramax will use the EXIF-data // It might seem odd that we set 'undefined' here - keep in mind that, by default, panoramax will use the EXIF-data
// We only pass variables as fallback! // We only pass variables as fallback!

View file

@ -50,7 +50,7 @@ export default class Constants {
...Constants.no_include, ...Constants.no_include,
] as const ] as const
public static panoramax: { url: string; token: string } = packagefile.config.panoramax public static panoramax: { url: string; token: string, sequence: string } = packagefile.config.panoramax
// The user journey states thresholds when a new feature gets unlocked // The user journey states thresholds when a new feature gets unlocked
public static userJourney = { public static userJourney = {