forked from MapComplete/MapComplete
Merge branch 'master' into develop
This commit is contained in:
commit
7c6ebc959c
161 changed files with 11056 additions and 2506 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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... "
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue