Merge branch 'dev' into dev_1.1.2

This commit is contained in:
董宏宇
2020-07-31 16:38:50 +08:00
89 changed files with 6186 additions and 331 deletions

View File

@@ -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 );
}