forked from MapComplete/MapComplete
Merge branch 'master' into develop
This commit is contained in:
commit
b99a857edc
124 changed files with 1731 additions and 921 deletions
|
|
@ -10,6 +10,7 @@ import Translations from "../../UI/i18n/Translations"
|
|||
import { Translation } from "../../UI/i18n/Translation"
|
||||
import { IndexedFeatureSource } from "../FeatureSource/FeatureSource"
|
||||
import { GeoOperations } from "../GeoOperations"
|
||||
import { Feature } from "geojson"
|
||||
|
||||
/**
|
||||
* The ImageUploadManager has a
|
||||
|
|
@ -155,7 +156,8 @@ export class ImageUploadManager {
|
|||
author: string,
|
||||
blob: File,
|
||||
targetKey: string | undefined,
|
||||
noblur: boolean
|
||||
noblur: boolean,
|
||||
feature?: Feature
|
||||
): Promise<UploadResult> {
|
||||
this.increaseCountFor(this._uploadStarted, featureId)
|
||||
let key: string
|
||||
|
|
@ -166,7 +168,7 @@ export class ImageUploadManager {
|
|||
location = [this._gps.data.longitude, this._gps.data.latitude]
|
||||
}
|
||||
if (location === undefined || location?.some((l) => l === undefined)) {
|
||||
const feature = this._indexedFeatures.featuresById.data.get(featureId)
|
||||
feature ??= this._indexedFeatures.featuresById.data.get(featureId)
|
||||
location = GeoOperations.centerpointCoordinates(feature)
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -197,8 +197,15 @@ export class PanoramaxUploader implements ImageUploader {
|
|||
let datetime = new Date().toISOString()
|
||||
try {
|
||||
const tags = await ExifReader.load(blob)
|
||||
lat = Number(tags?.GPSLatitude?.description)
|
||||
lon = Number(tags?.GPSLongitude?.description)
|
||||
const [[latD], [latM], [latS, latSDenom]] = <
|
||||
[[number, number], [number, number], [number, number]]
|
||||
>tags?.GPSLatitude.value
|
||||
const [[lonD], [lonM], [lonS, lonSDenom]] = <
|
||||
[[number, number], [number, number], [number, number]]
|
||||
>tags?.GPSLongitude.value
|
||||
lat = latD + latM / 60 + latS / (3600 * latSDenom)
|
||||
lon = lonD + lonM / 60 + lonS / (3600 * lonSDenom)
|
||||
|
||||
const [date, time] = tags.DateTime.value[0].split(" ")
|
||||
datetime = new Date(date.replaceAll(":", "-") + "T" + time).toISOString()
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
import Camera from "@babeard/svelte-heroicons/solid/Camera"
|
||||
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
||||
import NoteCommentElement from "../Popup/Notes/NoteCommentElement"
|
||||
import type { Feature } from "geojson"
|
||||
|
||||
export let state: SpecialVisualizationState
|
||||
|
||||
|
|
@ -23,6 +24,7 @@
|
|||
export let targetKey: string = undefined
|
||||
export let layer: LayerConfig
|
||||
export let noBlur: boolean = false
|
||||
export let feature: Feature = undefined
|
||||
/**
|
||||
* Image to show in the button
|
||||
* NOT the image to upload!
|
||||
|
|
@ -54,7 +56,8 @@
|
|||
state.osmConnection.userDetails.data?.name ?? "Anonymous",
|
||||
file,
|
||||
"image",
|
||||
noBlur
|
||||
noBlur,
|
||||
feature
|
||||
)
|
||||
if (!uploadResult) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1114,7 +1114,7 @@ export default class SpecialVisualizations {
|
|||
constr: (state, tags, args, feature, layer) => {
|
||||
const id = tags.data[args[0] ?? "id"]
|
||||
tags = state.featureProperties.getStore(id)
|
||||
return new SvelteUIElement(UploadImage, { state, tags, layer })
|
||||
return new SvelteUIElement(UploadImage, { state, tags, layer, feature })
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"contributors": [
|
||||
{
|
||||
"commits": 8513,
|
||||
"commits": 8525,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
|
|
@ -164,6 +164,10 @@
|
|||
"commits": 4,
|
||||
"contributor": "Ward Beyens"
|
||||
},
|
||||
{
|
||||
"commits": 3,
|
||||
"contributor": "Languages add-on"
|
||||
},
|
||||
{
|
||||
"commits": 3,
|
||||
"contributor": "Thierry1030"
|
||||
|
|
@ -178,7 +182,7 @@
|
|||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "Languages add-on"
|
||||
"contributor": "Kim Minwoo"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"contributors": [
|
||||
{
|
||||
"commits": 485,
|
||||
"commits": 486,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
"contributor": "Anonymous"
|
||||
},
|
||||
{
|
||||
"commits": 101,
|
||||
"commits": 102,
|
||||
"contributor": "mcliquid"
|
||||
},
|
||||
{
|
||||
|
|
@ -34,14 +34,14 @@
|
|||
},
|
||||
{
|
||||
"commits": 53,
|
||||
"contributor": "Harry Bond"
|
||||
},
|
||||
{
|
||||
"commits": 49,
|
||||
"contributor": "mike140"
|
||||
},
|
||||
{
|
||||
"commits": 48,
|
||||
"commits": 53,
|
||||
"contributor": "Harry Bond"
|
||||
},
|
||||
{
|
||||
"commits": 50,
|
||||
"contributor": "Jiří Podhorecký"
|
||||
},
|
||||
{
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
"contributor": "Babos Gábor"
|
||||
},
|
||||
{
|
||||
"commits": 36,
|
||||
"commits": 37,
|
||||
"contributor": "Lucas"
|
||||
},
|
||||
{
|
||||
|
|
@ -420,6 +420,10 @@
|
|||
"commits": 3,
|
||||
"contributor": "SiegbjornSitumeang"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "David Crochet"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "Ryan C"
|
||||
|
|
@ -544,6 +548,10 @@
|
|||
"commits": 2,
|
||||
"contributor": "Leo Alcaraz"
|
||||
},
|
||||
{
|
||||
"commits": 1,
|
||||
"contributor": "Kim Minwoo"
|
||||
},
|
||||
{
|
||||
"commits": 1,
|
||||
"contributor": "Teodor11"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue