[3.4.0-map-sdk] fix bug of mapview init when biz use

This commit is contained in:
zhongchao
2023-09-19 11:46:56 +08:00
parent efb4bb8070
commit fda0c0ab62
9 changed files with 20 additions and 20 deletions

View File

@@ -87,14 +87,14 @@ class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
okView?.setOnClickListener {
if (isLoading) {
mogoMapData.get().cancelDownloadCacheData()
mogoMapData.get()?.cancelDownloadCacheData()
}
dismiss()
}
}
private fun cacheHDDataByCityByLonLat() {
mogoMapData.get().cacheHDDataByCityByLonLat(location!!, { _, progress ->
mogoMapData.get()?.cacheHDDataByCityByLonLat(location!!, { _, progress ->
if (Thread.currentThread() != Looper.getMainLooper().thread) {
ThreadUtils.runOnUiThread({
updateProgress(progress.toInt())
@@ -119,7 +119,7 @@ class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
private fun cacheHDOfflineData() {
if (location == null) {// 拿到了高德地图的cityCode
mogoMapData.get().cacheHDDataByCity({ _, progress ->
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
if (Thread.currentThread() != Looper.getMainLooper().thread) {
ThreadUtils.runOnUiThread({
updateProgress(progress.toInt())

View File

@@ -591,7 +591,7 @@ internal class DebugSettingView @JvmOverloads constructor(
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
ThreadUtils.getIoPool().execute {
mogoMapData.get().isCityDataCached {
mogoMapData.get()?.isCityDataCached {
isHDCached = it
UiThreadHandler.post {
btn_cache_hd_map.text = "缓存高精离线地图(${if (it) "已是最新版" else "待更新"}!)"
@@ -1301,7 +1301,7 @@ internal class DebugSettingView @JvmOverloads constructor(
* 设置是否输出高精地图日志 true-打印日志false-不打印日志
*/
tbHdMapLog.setOnCheckedChangeListener { _, isChecked ->
mogoMapData.get().setDebugMode(isChecked)
mogoMapData.get()?.setDebugMode(isChecked)
}
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
@@ -2155,7 +2155,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private fun cacheHDOfflineData(isGaoDe: Boolean) {
if (isGaoDe) {// 拿到了高德地图的cityCode
mogoMapData.get().cacheHDDataByCity({ _, progress ->
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
if (Thread.currentThread() != Looper.getMainLooper().thread) {
ThreadUtils.runOnUiThread(Runnable {
cacheHDCityProgressUpdate(progress)
@@ -2174,7 +2174,7 @@ internal class DebugSettingView @JvmOverloads constructor(
})
} else {// 只拿到了高精的经纬度
mGnssInfo?.let { loc ->
mogoMapData.get().cacheHDDataByCityByLonLat(loc, { _, progress ->
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc, { _, progress ->
if (Thread.currentThread() != Looper.getMainLooper().thread) {
ThreadUtils.runOnUiThread(Runnable {
cacheHDCityProgressUpdate(progress)

View File

@@ -160,7 +160,7 @@ class SystemVersionView @JvmOverloads constructor(
}
ThreadUtils.getIoPool().execute {
mogoMapData.get().isCityDataCached {
mogoMapData.get()?.isCityDataCached {
UiThreadHandler.post {
updateHDDataCacheStatus(it)
}