mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-05 12:54:35 +00:00
Use string template instead of multiple append invocations.
This commit is contained in:
+2
-7
@@ -32,16 +32,11 @@ internal class MapTilerTileServerStyleUriBuilder(
|
|||||||
return buildString {
|
return buildString {
|
||||||
if (customMapStyleUrl.isNullOrBlank()) {
|
if (customMapStyleUrl.isNullOrBlank()) {
|
||||||
val mapId = if (darkMode) darkMapId else lightMapId
|
val mapId = if (darkMode) darkMapId else lightMapId
|
||||||
append(baseUrl)
|
append("$baseUrl/$mapId/style.json")
|
||||||
append("/")
|
|
||||||
append(mapId)
|
|
||||||
append("/")
|
|
||||||
append("style.json")
|
|
||||||
} else {
|
} else {
|
||||||
append(customMapStyleUrl.removeSuffix("/"))
|
append(customMapStyleUrl.removeSuffix("/"))
|
||||||
}
|
}
|
||||||
append("?key=")
|
append("?key=$apiKey")
|
||||||
append(apiKey)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user