diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java index 6f1e3c704a..915f430be1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java @@ -22,6 +22,7 @@ import com.mogo.eagle.core.function.overview.InfStructureManager; import com.mogo.eagle.core.function.overview.ViewModelExtKt; import com.mogo.eagle.core.function.overview.vm.OverViewModel; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.IMogoMap; import com.mogo.map.IMogoUiSettings; import com.mogo.map.MogoMapView; @@ -213,7 +214,9 @@ public class MapFragment extends MvpFragment @Override public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp globalPathResp) { - InfStructureManager.INSTANCE.savePlanningData(globalPathResp.getWayPointsList()); + UiThreadHandler.post(() -> { + InfStructureManager.INSTANCE.savePlanningData(globalPathResp.getWayPointsList()); + }); } @Override diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index 0eac9be233..2159ede25a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -322,13 +322,14 @@ public class AMapCustomView * @param locationList */ private void drawInfrastructureMarkers(List locationList) { + if (locationList == null) return; if (!pathMap.isEmpty()) { pathMap.clear(); } String geoHash; ArrayList infList; - for (MessagePad.Location location : locationList) { - LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, location); + for (int i = 0; i < locationList.size(); i++) { + LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, locationList.get(i)); geoHash = GeoHash.withCharacterPrecision(latLng.latitude, latLng.longitude, 7).toBase32(); // 网格内的轨迹点只取一次s if (!pathMap.containsKey(geoHash)) {