Code review fix.

This commit is contained in:
Onuray Sahin 2022-02-07 20:08:31 +03:00
parent 9d83bafa7b
commit 22a03abdc4
1 changed files with 7 additions and 5 deletions

View File

@ -32,14 +32,16 @@ class UrlMapProvider @Inject constructor(
) {
private val keyParam = "?key=${BuildConfig.mapTilerKey}"
private val fallbackMapUrl = buildString {
append(MAP_BASE_URL)
append(keyParam)
}
suspend fun getMapUrl(): String {
return tryOrNull { rawService.getElementWellknown(session.sessionParams) }
val upstreamMapUrl = tryOrNull { rawService.getElementWellknown(session.sessionParams) }
?.mapTileServerConfig
?.mapStyleUrl
?: buildString {
append(MAP_BASE_URL)
append(keyParam)
}
return upstreamMapUrl ?: fallbackMapUrl
}
fun buildStaticMapUrl(locationData: LocationData,