This commit is contained in:
squallzhjch
2023-08-11 14:28:55 +08:00
parent 54b30d5db5
commit 00e197f264
5 changed files with 18 additions and 9 deletions

View File

@@ -158,13 +158,19 @@ class OfflineMapDownloadScope(
val res =
fileTemp.renameTo(File("${Constant.OFFLINE_MAP_PATH}${cityBean.fileName}"))
change(FileDownloadStatus.DONE)
withContext(Dispatchers.Main) {
downloadManager.mapController.layerManagerHandler.loadBaseMap()
try {
withContext(Dispatchers.Main) {
downloadManager.mapController.layerManagerHandler.loadBaseMap()
}
}catch (e:Throwable){
Log.e("jingo", "下载离线地图 load map ${e.message}")
}
} else {
change(FileDownloadStatus.PAUSE)
}
} catch (e: Throwable) {
Log.e("jingo", "下载离线地图 ${e.message}")
change(FileDownloadStatus.ERROR)
} finally {
inputStream?.close()