From d915d60a7d60b87c3f9d3839ec85234eb6a4c63f Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 9 Nov 2021 20:41:21 +0800 Subject: [PATCH] =?UTF-8?q?[Add=20function]=E9=87=8D=E6=9E=84=E4=BA=86?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E4=BD=8D=E7=BD=AE=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E6=96=B9=E5=BC=8F=EF=BC=9B=20//=20=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E7=9B=91=E5=90=AC=20=20CallerMapLocationListenerManag?= =?UTF-8?q?er.addListener(TAG,=20IMoGoMapLocationListener)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit // 主动查询 CallerMapLocationListenerManager.INSTANCE.getCurrentLocation() Signed-off-by: donghongyu --- .../hmi/ui/setting/DebugSettingView.kt | 12 ++- .../api/map/hd/IMoGoMapLocationListener.java | 18 ---- .../map/listener/IMoGoMapLocationListener.kt | 17 ++++ .../IMoGoMapStyleChangeListener.kt | 2 +- .../CallerAutoPilotStatusListenerManager.kt | 5 +- ...CallerAutopilotCarStatusListenerManager.kt | 5 +- .../CallerAutopilotIdentifyListenerManager.kt | 5 +- .../call/hmi/CallerHmiListenerManager.kt | 3 +- .../map/CallerMapLocationListenerManager.kt | 87 +++++++++++++++++++ ...er.kt => CallerMapStyleListenerManager.kt} | 11 +-- .../call/obu/CallerObuListenerManager.kt | 3 +- .../CallTrafficLightListenerManager.kt | 5 +- .../MogoLocationInfoServices.java | 3 +- .../mogo/map/impl/custom/AMapViewWrapper.java | 5 ++ .../impl/custom/location/ALocationClient.java | 2 + 15 files changed, 146 insertions(+), 37 deletions(-) delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapLocationListener.java create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt rename core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/{hd => listener}/IMoGoMapStyleChangeListener.kt (82%) create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt rename core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/{CallerMapListenerManager.kt => CallerMapStyleListenerManager.kt} (83%) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 632ef0b305..189946c138 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -14,17 +14,21 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.obu.ObuStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager import com.mogo.eagle.core.function.call.obu.CallerOBUManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.util.AppUtils import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.ToastUtils @@ -46,7 +50,7 @@ class DebugSettingView @JvmOverloads constructor( attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener, - IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener { + IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener, IMoGoMapLocationListener { private val TAG = "DebugSettingView" @@ -60,6 +64,7 @@ class DebugSettingView @JvmOverloads constructor( CallerObuListenerManager.addListener(TAG, this) CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerAutopilotCarStatusListenerManager.addListener(TAG, this) + CallerMapLocationListenerManager.addListener(TAG, this) } override fun onDetachedFromWindow() { @@ -67,6 +72,7 @@ class DebugSettingView @JvmOverloads constructor( CallerObuListenerManager.removeListener(TAG) CallerAutoPilotStatusListenerManager.removeListener(TAG) CallerAutopilotCarStatusListenerManager.removeListener(TAG) + CallerMapLocationListenerManager.removeListener(TAG) } private fun initView() { @@ -239,4 +245,8 @@ class DebugSettingView @JvmOverloads constructor( } + override fun onLocationChanged(location: MogoLocation?) { + Logger.d(TAG, "location:$location") + } + } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapLocationListener.java b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapLocationListener.java deleted file mode 100644 index e9da558b38..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapLocationListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.eagle.core.function.api.map.hd; - -import com.mogo.eagle.core.data.map.MogoLocation; - -/** - * @author xiaoyuzhou - * @date 2021/11/1 7:17 下午 - * 地图定位回调 - */ -public interface IMoGoMapLocationListener { - - /** - * 定位发生改变 - * - * @param location 新定位点 - */ - void onLocationChanged(MogoLocation location); -} diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt new file mode 100644 index 0000000000..9bcba46cd3 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt @@ -0,0 +1,17 @@ +package com.mogo.eagle.core.function.api.map.listener + +import com.mogo.eagle.core.data.map.MogoLocation + +/** + * @author xiaoyuzhou + * @date 2021/11/1 7:17 下午 + * 地图定位回调 + */ +interface IMoGoMapLocationListener { + /** + * 定位发生改变 + * + * @param location 新定位点 + */ + fun onLocationChanged(location: MogoLocation?) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapStyleChangeListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapStyleChangeListener.kt similarity index 82% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapStyleChangeListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapStyleChangeListener.kt index b9412ab2cf..a33a92007b 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/hd/IMoGoMapStyleChangeListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapStyleChangeListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.map.hd +package com.mogo.eagle.core.function.api.map.listener /** *@author xiaoyuzhou diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index 0e45501c98..f0049b7dab 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -8,6 +8,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.util.GsonUtils +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou @@ -21,8 +22,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo() // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val M_AUTOPILOT_STATUS_LISTENERS: HashMap = - HashMap() + private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = + ConcurrentHashMap() /** * 查询AutoPilot状态 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt index e7f2ad4cc8..cef8278203 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt @@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.mogo.logger.Logger +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou @@ -15,8 +16,8 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { private val TAG = "CallerAutopilotCarStatusListenerManager" // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val M_AUTOPILOT_STATUS_LISTENERS: HashMap = - HashMap() + private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = + ConcurrentHashMap() /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt index 07f8c78e38..ba8e481606 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt @@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.mogo.logger.Logger +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou @@ -16,8 +17,8 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() { private val TAG = "CallerAutopilotIdentifyListenerManager" // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val M_AUTOPILOT_IDENTIFY_LISTENERS: HashMap = - HashMap() + private val M_AUTOPILOT_IDENTIFY_LISTENERS: ConcurrentHashMap = + ConcurrentHashMap() /** * 添加监听 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt index 80471e413a..9f89094737 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt @@ -4,6 +4,7 @@ import androidx.annotation.Nullable import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.util.LogUtils +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou @@ -18,7 +19,7 @@ object CallerHmiListenerManager : CallerBase() { private var mIsChecked: Boolean = false // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val mAutoPilotBtnListeners: HashMap = HashMap() + private val mAutoPilotBtnListeners: ConcurrentHashMap = ConcurrentHashMap() /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt new file mode 100644 index 0000000000..6c2608b095 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt @@ -0,0 +1,87 @@ +package com.mogo.eagle.core.function.call.map + +import androidx.annotation.Nullable +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.util.LogUtils +import java.util.concurrent.ConcurrentHashMap + +/** + * @author xiaoyuzhou + * @date 2021/9/30 5:48 下午 + * 地图 位置改变 监听管理 + */ +object CallerMapLocationListenerManager : CallerBase() { + private val TAG = "CallerMapLocationListenerManager" + + // 记录地图最后一次位置 + private var mLocation: MogoLocation? = null + + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 + private val mMapStyleChangeListeners: ConcurrentHashMap = + ConcurrentHashMap() + + /** + * 获取当前经纬度 + */ + fun getCurrentLocation(): MogoLocation? { + return mLocation + } + + /** + * 添加 地图样式改变 监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener( + @Nullable tag: String, + @Nullable listener: IMoGoMapLocationListener + ) { + mMapStyleChangeListeners[tag] = listener + listener.onLocationChanged(mLocation) + } + + /** + * 删除 地图样式改变 监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + mMapStyleChangeListeners.remove(tag) + } + + /** + * 删除 地图样式改变 监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMoGoMapLocationListener) { + mMapStyleChangeListeners.forEach { + if (it.value == listener) { + mMapStyleChangeListeners.remove(it.key) + } + } + } + + /** + * 触发 地图样式改变 监听 + */ + fun invokeMapLocationChangeListener() { + invokeMapLocationChangeListener(mLocation) + } + + /** + * 触发 地图样式改变 监听 + * @param location 选中状态 + */ + fun invokeMapLocationChangeListener(location: MogoLocation?) { + LogUtils.dTag(TAG, "mapStyleMode:$location") + mLocation = location + mMapStyleChangeListeners.forEach { + val tag = it.key + val listener = it.value + LogUtils.dTag(TAG, "tag:$tag listener:$listener") + listener.onLocationChanged(location) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapStyleListenerManager.kt similarity index 83% rename from core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapListenerManager.kt rename to core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapStyleListenerManager.kt index 5518d460c8..cfdb677f16 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapStyleListenerManager.kt @@ -1,23 +1,24 @@ package com.mogo.eagle.core.function.call.map import androidx.annotation.Nullable -import com.mogo.eagle.core.function.api.map.hd.IMoGoMapStyleChangeListener +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapStyleChangeListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.util.LogUtils +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou * @date 2021/9/30 5:48 下午 - * 地图 监听管理 + * 地图 样式改变 监听管理 */ -object CallerMapListenerManager : CallerBase() { - private val TAG = "CallerMapListenerManager" +object CallerMapStyleListenerManager : CallerBase() { + private val TAG = "CallerMapStyleListenerManager" // 记录地图样式 private var mMapStyleMode = 0 // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val mMapStyleChangeListeners: HashMap = HashMap() + private val mMapStyleChangeListeners: ConcurrentHashMap = ConcurrentHashMap() /** * 添加 地图样式改变 监听 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt index 7e75e9824e..53efcb29eb 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt @@ -6,6 +6,7 @@ import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.LogUtils +import java.util.concurrent.ConcurrentHashMap /** * @author xiaoyuzhou @@ -19,7 +20,7 @@ object CallerObuListenerManager : CallerBase() { private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo() // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val mObuStatusListeners: HashMap = HashMap() + private val mObuStatusListeners: ConcurrentHashMap = ConcurrentHashMap() /** * 查询 OBU状态 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt index ee96f69987..0f990f6dcd 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt @@ -4,13 +4,14 @@ import androidx.annotation.Nullable import com.mogo.eagle.core.data.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener import com.mogo.eagle.core.utilcode.mogo.logger.Logger +import java.util.concurrent.ConcurrentHashMap object CallTrafficLightListenerManager { private val TAG = "CallTrafficLightListenerManager" - private val M_TRAFFIC_LIGHT_LISTENER: HashMap = - HashMap() + private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = + ConcurrentHashMap() private var trafficLightResult:TrafficLightResult? = null diff --git a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationInfoServices.java b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationInfoServices.java index cd1804d204..6f93f0535e 100644 --- a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationInfoServices.java +++ b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationInfoServices.java @@ -10,7 +10,6 @@ import com.mogo.service.cloud.location.IMogoLocationInfoService; import com.mogo.utils.logger.Logger; @Keep - public class MogoLocationInfoServices implements IMogoLocationInfoService { private static final String TAG = "MogoLocationInfoServices-sdk"; @@ -40,7 +39,7 @@ public class MogoLocationInfoServices implements IMogoLocationInfoService { @Override public void provideLocation(MogoLocation location) { mLocation = location; - Logger.d(TAG, "sdk - provideLocation"); + // Logger.d(TAG, "sdk - provideLocation"); } public MogoLocation getLocation() { diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 5b87265b7d..7d3b31d5a2 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -23,7 +23,9 @@ import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager; +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; import com.mogo.map.IMogoMap; import com.mogo.map.IMogoMapView; @@ -732,6 +734,9 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) { + MogoLocation mLastLocation = ObjectUtils.fromLocation(location); + CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation); + Location sysLocation = new Location(location.getProvider()); sysLocation.setAltitude(location.getAltitude()); sysLocation.setLatitude(location.getLat()); diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java index 90059ded7e..e5315c6f86 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java @@ -3,6 +3,7 @@ package com.mogo.map.impl.custom.location; import android.content.Context; import android.os.Trace; +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.map.impl.custom.utils.ObjectUtils; import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.location.IMogoLocationListener; @@ -122,6 +123,7 @@ public class ALocationClient implements IMogoLocationClient { } Trace.beginSection( "timer.onLocationChanged" ); mLastLocation = ObjectUtils.fromLocation( location ); + CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation); Set< IMogoLocationListener > listeners = MogoLocationListenerRegister.getInstance().getListeners(); synchronized ( listeners ) { Iterator< IMogoLocationListener > listenerIterator = listeners.iterator();