fixed map download

pull/489/head
PWRxPSYCHO 2022-10-07 17:26:57 -04:00
rodzic 07ed060e16
commit a30a8428ce
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -153,13 +153,13 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
activity activity
) )
// set title // set title
alertDialogBuilder.setTitle("Cache Manager") alertDialogBuilder.setTitle("Offline Manager")
// set dialog message // set dialog message
alertDialogBuilder.setItems( alertDialogBuilder.setItems(
arrayOf<CharSequence>( arrayOf<CharSequence>(
"Current Cache size", "Current Cache size",
"Download Region", "Download Region",
"Clear Cache", "Clear Downloaded Tiles",
resources.getString(R.string.cancel) resources.getString(R.string.cancel)
) )
) { dialog, which -> ) { dialog, which ->
@ -255,7 +255,7 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
drawOverlays() drawOverlays()
map.setMultiTouchControls(false) map.setMultiTouchControls(false)
zoomLevelMax = zoomLevel zoomLevelMax = zoomLevel
zoomLevelMin = map.tileProvider.tileSource.minimumZoomLevel.toDouble() zoomLevelMin = map.tileProvider.tileSource.maximumZoomLevel.toDouble()
mapController.setZoom(zoomLevel) mapController.setZoom(zoomLevel)
downloadRegionBoundingBox = map.boundingBox downloadRegionBoundingBox = map.boundingBox
val polygon = Polygon() val polygon = Polygon()
@ -266,8 +266,8 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
val tilecount: Int = val tilecount: Int =
cacheManager.possibleTilesInArea( cacheManager.possibleTilesInArea(
downloadRegionBoundingBox, downloadRegionBoundingBox,
zoomLevelMin.toInt(), zoomLevelMax.toInt(),
zoomLevelMax.toInt() zoomLevelMin.toInt()
) )
cacheEstimate.text = ("$tilecount tiles") cacheEstimate.text = ("$tilecount tiles")
} }
@ -298,8 +298,8 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
//this triggers the download //this triggers the download
downloadRegion( downloadRegion(
downloadRegionBoundingBox, downloadRegionBoundingBox,
zoomLevelMax.toInt(),
zoomLevelMin.toInt(), zoomLevelMin.toInt(),
zoomLevelMax.toInt()
) )
} }
} catch (ex: Exception) { } catch (ex: Exception) {