[2.10.0] bus司机端切换路线时清除原路线起终点

This commit is contained in:
wangmingjun
2022-09-09 18:28:50 +08:00
parent d8a607aefc
commit bf2f02a5c5
5 changed files with 26 additions and 8 deletions

View File

@@ -10,4 +10,5 @@ import java.util.List;
*/
public interface IRefreshBusStationsCallback {
void refreshBusStations(String lineName,List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
void clearBusStationsMarkers();
}

View File

@@ -317,14 +317,19 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
hideSlidePanel();
hidPanel();
//移除起点终点
if (null != startStation) {
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
, startStation.getLon(),R.raw.star_marker);
}
if (null != endStation) {
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
}
clearBusStationsMarkers();
}
}
public void clearBusStationsMarkers(){
CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()");
if (null != startStation) {
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
, startStation.getLon(),R.raw.star_marker);
}
if (null != endStation) {
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
}
}

View File

@@ -819,6 +819,12 @@ public class BusOrderModel {
BusTrajectoryManager.getInstance().syncTrajectoryInfo();
}
public void clearBusStationDatas(){
if (refreshBusStationsCallback != null){
refreshBusStationsCallback.clearBusStationsMarkers();
}
}
/**
* 根据订单状态、获取下一站靠站的的站点
*

View File

@@ -53,6 +53,7 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onChangeLineIdSuccess() {
BusOrderModel.getInstance().clearBusStationDatas();
runOnUIThread(() -> mView.onChangeLineIdSuccess());
}

View File

@@ -137,6 +137,11 @@ public class BusPresenter extends Presenter<BusFragment>
}
}
@Override
public void clearBusStationsMarkers() {
runOnUIThread(() -> mView.clearBusStationsMarkers());
}
private void functionDemoModeChange() {
// CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel ="," functionDemoModeChange ="+mCurrentStation);
if (FunctionBuildConfig.isDemoMode