Merge develop

This commit is contained in:
Pieter Vander Vennet 2023-10-30 16:32:43 +01:00
commit 29ff09024f
287 changed files with 14955 additions and 4036 deletions

View file

@ -75,6 +75,16 @@ export default class FeatureSwitchState extends OsmConnectionFeatureSwitches {
layoutToUse?.enableUserBadge ?? true,
"Disables/Enables logging in and thus disables editing all together. This effectively puts MapComplete into read-only mode."
)
{
if (QueryParameters.wasInitialized("fs-userbadge")) {
// userbadge is the legacy name for 'enable-login'
this.featureSwitchEnableLogin.setData(
QueryParameters.GetBooleanQueryParameter("fs-userbadge", undefined, "Legacy")
.data
)
}
}
this.featureSwitchSearch = FeatureSwitchUtils.initSwitch(
"fs-search",
layoutToUse?.enableSearch ?? true,

View file

@ -102,6 +102,10 @@ export class GeoLocationState {
this.requestPermissionAsync()
}
public static isSafari(): boolean {
return navigator.permissions === undefined && navigator.geolocation !== undefined
}
/**
* Requests the user to allow access to their position.
* When granted, will be written to the 'geolocationState'.
@ -119,8 +123,12 @@ export class GeoLocationState {
return
}
if (navigator.permissions === undefined && navigator.geolocation !== undefined) {
// This is probably safari - we just start watching right away
if (GeoLocationState.isSafari()) {
// This is probably safari
// Safari does not support the 'permissions'-API for geolocation,
// so we just start watching right away
this.permission.setData("requested")
this.startWatching()
return
}