diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java index b2065a807c..1d4cdb1e0b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java @@ -22,16 +22,9 @@ public class MapCenterPointStrategy { public static final MapCenterPoint DEFAULT = new MapCenterPoint( 0.677734D, 0.5733333D ); - public static void init() { - // 普通场景,使用高德内部值 - { - Map< Integer, MapCenterPoint > common = new HashMap<>(); - common.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.666666666D ) ); - common.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.5D, 0.666666666D ) ); - common.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.5D, 0.666666666D ) ); - common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) ); - sStrategies.put( Scene.COMMON, common ); - } + private static MapCenterPoint sLastPoint = DEFAULT; + + public static void init() { { // 选点场景,定位中心点 @@ -112,6 +105,22 @@ public class MapCenterPointStrategy { categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) ); sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent ); } + + try { + sLastPoint = sStrategies.get( Scene.AIMLESS ).get( CarSeries.getSeries() ); + } catch ( Exception e ) { + sLastPoint = DEFAULT; + } + } + + public static void restoreLastScene( IMogoMapUIController controller ) { + if ( sLastPoint == null ) { + return; + } + if ( controller == null ) { + return; + } + controller.setPointToCenter( sLastPoint.x, sLastPoint.y ); } public static void addScene( int scene, Map< Integer, MapCenterPoint > config ) { @@ -138,6 +147,7 @@ public class MapCenterPointStrategy { if ( !sStrategies.containsKey( scene ) ) { Logger.w( TAG, "no strategy for scene: %s, use DEFAULT", scene ); controller.setPointToCenter( DEFAULT.x, DEFAULT.y ); + sLastPoint = DEFAULT; return; } Map< Integer, MapCenterPoint > points = sStrategies.get( scene ); @@ -145,14 +155,17 @@ public class MapCenterPointStrategy { if ( !points.containsKey( car ) ) { Logger.w( TAG, "no strategy for series: %s, use DEFAULT", scene ); controller.setPointToCenter( DEFAULT.x, DEFAULT.y ); + sLastPoint = DEFAULT; return; } MapCenterPoint point = points.get( car ); if ( point == null ) { Logger.w( TAG, "no strategy config for series: %s, use DEFAULT", scene ); controller.setPointToCenter( DEFAULT.x, DEFAULT.y ); + sLastPoint = DEFAULT; return; } + sLastPoint = point; controller.setPointToCenter( point.x, point.y ); } diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index f977a83e41..a15d148a4b 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -192,6 +192,7 @@ public class EntranceFragment extends MvpFragment { - // todo 测试代码 -// mApis.getEventPanelManager().showPanel(); - // 原始逻辑 try { LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal"); // 埋点 @@ -354,6 +352,7 @@ public class EntranceFragment extends MvpFragment { - if (!isTrue) { - TopViewAnimHelper.getInstance().removeAllView(); - } - }); } @Override