diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 6182939d78..b32b7b3793 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -52,7 +52,8 @@ class OverMapView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : RelativeLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener { +) : RelativeLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener, + IMoGoPlanningRottingListener { // =============自定义属性相关============= private var mapStylePath: String? = null @@ -166,7 +167,7 @@ class OverMapView @JvmOverloads constructor( overLayerView?.background = resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset) arrivedBitmap = BitmapDescriptorFactory.fromResource(if (arrivedDrawable != -1) arrivedDrawable else R.drawable.taxi_map_arrow_arrived) unArrivedBitmap = BitmapDescriptorFactory.fromResource(if (unArrivedDrawable != -1) unArrivedDrawable else R.drawable.taxi_map_arrow_un_arrive) - CallerPlanningRottingListenerManager.addListener(TAG, moGoAutopilotPlanningListener) + CallerPlanningRottingListenerManager.addListener(TAG, this) initAMapView(context) // 注册定位监听 CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this) @@ -262,20 +263,6 @@ class OverMapView @JvmOverloads constructor( ) } - private val moGoAutopilotPlanningListener: IMoGoPlanningRottingListener = - object : IMoGoPlanningRottingListener { - /** - * 根据全路径获取起始点和经停点进行导航路线绘制 - * 自动驾驶启动后获得数据,获取全路径的具体时间要进行路测 - * 室内某个bag包自动驾驶启动8s后返回 - */ - override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { - globalPathResp?.let { - handlePlanningData(it.wayPointsList) - } - } - } - fun handlePlanningData(locationList: List?) { if (locationList.isNullOrEmpty()) return val list: List = locationList @@ -600,4 +587,15 @@ class OverMapView @JvmOverloads constructor( } } + + /** + * 根据全路径获取起始点和经停点进行导航路线绘制 + * 自动驾驶启动后获得数据,获取全路径的具体时间要进行路测 + * 室内某个bag包自动驾驶启动8s后返回 + */ + override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { + globalPathResp?.let { + handlePlanningData(it.wayPointsList) + } + } } \ No newline at end of file