[3.4.0-map-sdk] fix bug of mapview init when biz use
This commit is contained in:
@@ -28,7 +28,7 @@ class TrafficLightNetWorkModel {
|
||||
request<BaseResponse<RoadIDResult>>("requestRoadID") {
|
||||
loader {
|
||||
apiCall {
|
||||
val tileId = mogoMapData.get().getTileId(lon, lat)
|
||||
val tileId = mogoMapData.get()?.getTileId(lon, lat)?:0
|
||||
val map = hashMapOf<String, String>()
|
||||
val roadIDRequestData = RoadIDRequestData(tileId, lat, lon, bearing)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
@@ -91,7 +91,7 @@ class AiRoadMarker {
|
||||
if (drawRoadLine) {
|
||||
//施工中心点前方的自车行驶方向上300米距离
|
||||
var l1: CenterLine? = null
|
||||
mogoMapData.get().getCenterLineRangeInfo(
|
||||
mogoMapData.get()?.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.heading.toFloat(),
|
||||
@@ -103,7 +103,7 @@ class AiRoadMarker {
|
||||
}
|
||||
})
|
||||
var l2: CenterLine? = null
|
||||
mogoMapData.get().getCenterLineRangeInfo(
|
||||
mogoMapData.get()?.getCenterLineRangeInfo(
|
||||
marker.poi_lon,
|
||||
marker.poi_lat,
|
||||
location.heading.toFloat(),
|
||||
|
||||
@@ -224,7 +224,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = true
|
||||
config.isShowNetDebugLog = true
|
||||
}
|
||||
MogoData.mogoMapData.get().setDebugMode(true)
|
||||
// MogoData.mogoMapData.get()?.setDebugMode(true)
|
||||
CallerAutoPilotControlManager.setEnableLog(true)
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = false
|
||||
config.isShowNetDebugLog = false
|
||||
}
|
||||
MogoData.mogoMapData.get().setDebugMode(false)
|
||||
// MogoData.mogoMapData.get()?.setDebugMode(false)
|
||||
CallerAutoPilotControlManager.setEnableLog(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -160,7 +160,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
ThreadUtils.getIoPool().execute {
|
||||
mogoMapData.get().isCityDataCached {
|
||||
mogoMapData.get()?.isCityDataCached {
|
||||
UiThreadHandler.post {
|
||||
updateHDDataCacheStatus(it)
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ object CacheHDMapManager {
|
||||
fun scheduleGetLocation() {
|
||||
if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
ThreadUtils.getIoPool().execute {
|
||||
mogoMapData.get().isCityDataCached {
|
||||
mogoMapData.get()?.isCityDataCached {
|
||||
if(!it){
|
||||
while (true) {
|
||||
val loc =
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (loc.latitude != 0.0 || loc.longitude != 0.0) {
|
||||
CallerLogger.d(TAG, "开始下载")
|
||||
mogoMapData.get().cacheHDDataByCityByLonLat(loc,
|
||||
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc,
|
||||
{ _, progress ->
|
||||
CallerLogger.i(M_MAP + TAG, "下载进度:${progress.toInt()}")
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user