Code review fix.
This commit is contained in:
parent
9d83bafa7b
commit
22a03abdc4
@ -32,14 +32,16 @@ class UrlMapProvider @Inject constructor(
|
|||||||
) {
|
) {
|
||||||
private val keyParam = "?key=${BuildConfig.mapTilerKey}"
|
private val keyParam = "?key=${BuildConfig.mapTilerKey}"
|
||||||
|
|
||||||
|
private val fallbackMapUrl = buildString {
|
||||||
|
append(MAP_BASE_URL)
|
||||||
|
append(keyParam)
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun getMapUrl(): String {
|
suspend fun getMapUrl(): String {
|
||||||
return tryOrNull { rawService.getElementWellknown(session.sessionParams) }
|
val upstreamMapUrl = tryOrNull { rawService.getElementWellknown(session.sessionParams) }
|
||||||
?.mapTileServerConfig
|
?.mapTileServerConfig
|
||||||
?.mapStyleUrl
|
?.mapStyleUrl
|
||||||
?: buildString {
|
return upstreamMapUrl ?: fallbackMapUrl
|
||||||
append(MAP_BASE_URL)
|
|
||||||
append(keyParam)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildStaticMapUrl(locationData: LocationData,
|
fun buildStaticMapUrl(locationData: LocationData,
|
||||||
|
Loading…
Reference in New Issue
Block a user