diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/callback/DrivingInfoCallback.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/callback/DrivingInfoCallback.kt index fdd3966fe8..aaff2963b6 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/callback/DrivingInfoCallback.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/callback/DrivingInfoCallback.kt @@ -1,5 +1,7 @@ package com.mogo.och.bus.passenger.callback +import com.mogo.och.bus.passenger.bean.PM2Station + /** * @author: wangmingjun * @date: 2023/2/2 @@ -11,4 +13,5 @@ interface DrivingInfoCallback { fun updateRemainMT(meters : Long, timeInSecond : Long) // 米,秒 fun changeOperationStatus(loginStatus : Boolean) fun showNoTaskView(isTrue : Boolean) + fun updateLineStations(stations: MutableList) } \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index 1c1489d564..72de3ef1de 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -243,11 +243,12 @@ class PM2DrivingModel private constructor() { private fun updatePassengerRouteInfo(result: PM2RoutesResult) { mDrivingInfoCallback?.updateLine(result.name, result.runningDur) - mDrivingInfoCallback?.showNoTaskView(false) if (result.sites != null) { + mDrivingInfoCallback?.showNoTaskView(false) val stations: List = result.sites mStations.clear() mStations.addAll(stations) + mDrivingInfoCallback?.updateLineStations(mStations) for (i in stations.indices) { val station: PM2Station = stations[i] if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt index 1c9f06a422..3b97f18573 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt @@ -3,6 +3,7 @@ package com.mogo.och.bus.passenger.presenter import androidx.lifecycle.LifecycleOwner import com.mogo.commons.mvp.Presenter import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.och.bus.passenger.bean.PM2Station import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback import com.mogo.och.bus.passenger.callback.DrivingInfoCallback import com.mogo.och.bus.passenger.model.PM2DrivingModel @@ -65,6 +66,12 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) : } } + override fun updateLineStations(stations: MutableList) { + UiThreadHandler.post { + mView?.updateLineStations(stations) + } + } + override fun updateAutoStatus(isOpen: Boolean) { UiThreadHandler.post { mView?.updateAutoStatus(isOpen) @@ -72,6 +79,6 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) : } override fun updateAutoStatus(status: Int) { - TODO("Not yet implemented") + } } \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt index 3e127dd7c7..1249e4ae60 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt @@ -1,11 +1,14 @@ package com.mogo.och.bus.passenger.ui +import android.graphics.BitmapFactory import android.os.Bundle import android.view.View import androidx.core.content.ContextCompat +import com.amap.api.maps.model.LatLng import com.mogo.commons.mvp.MvpFragment import com.mogo.eagle.core.utilcode.util.DateTimeUtils import com.mogo.och.bus.passenger.R +import com.mogo.och.bus.passenger.bean.PM2Station import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter import com.mogo.och.common.module.utils.DateTimeUtil.* import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.* @@ -98,6 +101,8 @@ class PM2DrivingInfoFragment : line_name_tv.visibility = View.GONE line_during_tv.visibility = View.GONE no_line_tv.visibility = View.VISIBLE + overMapView.clearSiteMarkers() + overMapView.clearCustomPolyline() } } @@ -115,6 +120,17 @@ class PM2DrivingInfoFragment : } } + fun updateLineStations(stations: MutableList){ + var stationsList = mutableListOf() + for (i in stations.indices){ + val station = stations[i] + var latLng = LatLng(station.gcjLat,station.gcjLon) + stationsList.add(latLng) + } + overMapView?.drawSiteMarkers(stationsList, + BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f) + } + companion object { private val TAG = PM2DrivingInfoFragment::class.java.simpleName } diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png new file mode 100644 index 0000000000..2efd3a52eb Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png new file mode 100644 index 0000000000..1314028434 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png differ diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml index a7c537ab67..450846493d 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml @@ -11,7 +11,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:mapStyleExtraPath="@string/m2_over_map_style_extra_path" - app:mapStylePath="@string/m2_over_map_style_path" /> + app:mapStylePath="@string/m2_over_map_style_path" + app:endPointDrawable="@drawable/m2_map_end_icon"/>