Merge branch 'master' into develop

This commit is contained in:
Pieter Vander Vennet 2023-10-30 13:45:02 +01:00
commit 7c6ebc959c
161 changed files with 11056 additions and 2506 deletions

View file

@ -331,9 +331,9 @@ export class GeoOperations {
const lines: string[] = []
let _features
if(Array.isArray(features)){
if (Array.isArray(features)) {
_features = features
}else{
} else {
_features = features.features
}

View file

@ -68,7 +68,11 @@ export class ImageUploadManager {
* @param tagsStore The tags of the feature
* @param targetKey Use this key to save the attribute under. Default: 'image'
*/
public async uploadImageAndApply(file: File, tagsStore: UIEventSource<OsmTags>, targetKey?: string): Promise<void> {
public async uploadImageAndApply(
file: File,
tagsStore: UIEventSource<OsmTags>,
targetKey?: string
): Promise<void> {
const sizeInBytes = file.size
const tags = tagsStore.data
const featureId = <OsmId>tags.id
@ -98,7 +102,13 @@ export class ImageUploadManager {
].join("\n")
console.log("Upload done, creating ")
const action = await this.uploadImageWithLicense(featureId, title, description, file, targetKey)
const action = await this.uploadImageWithLicense(
featureId,
title,
description,
file,
targetKey
)
if (!isNaN(Number(featureId))) {
// This is a map note
const url = action._url

View file

@ -72,7 +72,10 @@ export class OsmPreferences {
let i = 0
while (str !== "") {
if (str === undefined || str === "undefined") {
throw "Got 'undefined' or a literal string containing 'undefined' for a long preference with name "+key
throw (
"Got 'undefined' or a literal string containing 'undefined' for a long preference with name " +
key
)
}
if (i > 100) {
throw "This long preference is getting very long... "

View file

@ -76,9 +76,12 @@ export default class FeatureSwitchState extends OsmConnectionFeatureSwitches {
"Disables/Enables logging in and thus disables editing all together. This effectively puts MapComplete into read-only mode."
)
{
if(QueryParameters.wasInitialized("fs-userbadge")){
if (QueryParameters.wasInitialized("fs-userbadge")) {
// userbadge is the legacy name for 'enable-login'
this.featureSwitchEnableLogin.setData(QueryParameters.GetBooleanQueryParameter("fs-userbadge", undefined, "Legacy").data)
this.featureSwitchEnableLogin.setData(
QueryParameters.GetBooleanQueryParameter("fs-userbadge", undefined, "Legacy")
.data
)
}
}

View file

@ -102,8 +102,8 @@ export class GeoLocationState {
this.requestPermissionAsync()
}
public static isSafari(): boolean{
return navigator.permissions === undefined && navigator.geolocation !== undefined
public static isSafari(): boolean {
return navigator.permissions === undefined && navigator.geolocation !== undefined
}
/**