Fixed download by setting CacheManager after map has been fully setup

pull/489/head
PWRxPSYCHO 2022-09-22 14:56:09 -04:00
rodzic 4e61eac1cf
commit 3061fe9ded
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -94,6 +94,7 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener, OnSeek
setupMapProperties()
map.setTileSource(loadOnlineTileSourceBase())
cacheManager = CacheManager(map)
map.let {
if (view != null) {
mapController = map.controller
@ -260,7 +261,6 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener, OnSeek
downloadPrompt!!.dismiss()
downloadPrompt = null
}
//this triggers the download
cacheManager.downloadAreaAsync(activity,
bb,
@ -376,7 +376,6 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener, OnSeek
private fun setupMapProperties() {
if (this::map.isInitialized) {
cacheManager = CacheManager(map)
map.setDestroyMode(false) // keeps map instance alive when in the background.
map.isVerticalMapRepetitionEnabled = false // disables map repetition
map.setScrollableAreaLimitLatitude(