Merge branch 'main' of github.com:MM2-0/Kvaesitso

This commit is contained in:
MM20 2025-02-10 20:11:28 +01:00
commit bbb50e6e5e
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -74,7 +74,9 @@ class LocationSearchSettings internal constructor(
fun setOverpassUrl(overpassUrl: String?) {
var url = overpassUrl
if (url != null) {
if (url.isNullOrBlank()) {
url = DefaultOverpassUrl
} else {
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "https://$url"
}
@ -95,7 +97,9 @@ class LocationSearchSettings internal constructor(
fun setTileServer(tileServer: String?) {
var url = tileServer
if (url != null) {
if (url.isNullOrBlank()) {
url = DefaultTileServerUrl
} else {
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "https://$url"
}
@ -136,8 +140,8 @@ class LocationSearchSettings internal constructor(
}
companion object {
const val DefaultTileServerUrl = "https://tile.openstreetmap.org"
const val DefaultOverpassUrl = "https://overpass-api.de/"
const val DefaultTileServerUrl = "https://tile.openstreetmap.org/\${z}/\${x}/\${y}.png"
const val DefaultOverpassUrl = "https://overpass-api.de"
}
}