diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index d6af80ab4d..b621f93dfc 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider; 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.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -69,6 +70,7 @@ public class SmallMapFragment extends BaseFragment mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView); mSmallMapDirectionView.onCreateView(savedInstanceState); CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this); + CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this); } @Override @@ -95,7 +97,6 @@ public class SmallMapFragment extends BaseFragment @Override public void clearPolyline() { - CallerLogger.INSTANCE.i(M_MAP + TAG, "clearPolyline"); if (mSmallMapDirectionView != null) { UiThreadHandler.post(() -> mSmallMapDirectionView.clearPolyline()); } @@ -137,6 +138,7 @@ public class SmallMapFragment extends BaseFragment int tempStatus = autoPilotStatusInfo.getPilotmode(); CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus); if (tempStatus != 1) { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline"); clearPolyline(); }else if (tempStatus == 1 && autoPilotStatus == 0){ CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath"); @@ -170,13 +172,17 @@ public class SmallMapFragment extends BaseFragment if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) { return; } + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+globalPathResp.getWayPointsList().size()); + List latLngList = new ArrayList<>(); for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) { latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude())); } if (latLngList.size() > 0) { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"drawablePolyline"); drawablePolyline(latLngList); } else { + CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"clearPolyline"); clearPolyline(); } }