[Route]清掉缓存的引导线数据

[Route]清掉缓存的引导线数据
This commit is contained in:
renwj
2022-10-14 16:29:30 +08:00
parent 040cc745dc
commit 97e6d8636a
2 changed files with 9 additions and 8 deletions

View File

@@ -86,10 +86,12 @@ public class MogoRouteOverlayManager implements
return;
}
synchronized (queue) {
List<MessagePad.TrajectoryPoint> items = queue.peekLast();
if (items != null && !items.isEmpty()) {
Logger.d(TAG, "--- onLocationChanged -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]");
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing());
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
if (items != null && !items.isEmpty()) {
Logger.d(TAG, "--- onLocationChanged -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]");
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing());
}
}
}

View File

@@ -63,14 +63,13 @@ public class RouteOverlayDrawer {
}
public void clearMogoRouteOverlay() {
if (mRenderTask != null) {
mRenderHandler.removeCallbacks(mRenderTask);
}
if (mMoGoPolyline != null) {
mMoGoPolyline.remove();
mMoGoPolyline = null;
}
if (mRenderTask != null) {
mRenderHandler.removeCallbacks(mRenderTask);
}
}
private class RenderTask implements Runnable {