opt
This commit is contained in:
@@ -157,7 +157,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
options.setNaviArrowVisible( false );
|
||||
// 通过路线是否自动置灰,仅支持驾车导航
|
||||
options.setAfterRouteAutoGray( true );
|
||||
options.setZoom( 16 );
|
||||
options.setZoom( ( ( int ) mDefaultZoomLevel ) );
|
||||
options.setPointToCenter( 0.5D, 0.5D );
|
||||
// 2D模式
|
||||
options.setTilt( 0 );
|
||||
@@ -295,7 +295,9 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onPolylineClick( Polyline polyline ) {
|
||||
NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline );
|
||||
if ( !NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -439,7 +441,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
case CarUp_3D:
|
||||
case NorthUP_2D:
|
||||
setUIMode( ui, options );
|
||||
break;
|
||||
return;
|
||||
case Type_Light:
|
||||
options.setNaviNight( false );
|
||||
break;
|
||||
|
||||
@@ -24,50 +24,76 @@ public class MapCenterPointStrategy {
|
||||
|
||||
static {
|
||||
// 普通场景,使用高德内部值
|
||||
Map< Integer, MapCenterPoint > common = new HashMap<>();
|
||||
common.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
sStrategies.put( Scene.COMMON, common );
|
||||
{
|
||||
Map< Integer, MapCenterPoint > common = new HashMap<>();
|
||||
common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
sStrategies.put( Scene.COMMON, common );
|
||||
}
|
||||
|
||||
// 选点场景,定位中心点
|
||||
Map< Integer, MapCenterPoint > choosePoint = new HashMap<>();
|
||||
choosePoint.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
choosePoint.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
|
||||
{
|
||||
// 选点场景,定位中心点
|
||||
Map< Integer, MapCenterPoint > choosePoint = new HashMap<>();
|
||||
choosePoint.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
choosePoint.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
|
||||
}
|
||||
|
||||
{
|
||||
// 导航场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > navi = new HashMap<>();
|
||||
navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.575D ) );
|
||||
sStrategies.put( Scene.NAVI, navi );
|
||||
}
|
||||
|
||||
// 导航场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > navi = new HashMap<>();
|
||||
navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.7734375D, 0.65D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.775521D, 0.661165D ) );
|
||||
sStrategies.put( Scene.NAVI, navi );
|
||||
{
|
||||
// 导航场景 vs 道路事件展示场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > naviWithRoadEvent = new HashMap<>();
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.68333333333D ) );
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
|
||||
sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent );
|
||||
}
|
||||
|
||||
{
|
||||
// 巡航场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > aimless = new HashMap<>();
|
||||
aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.5D ) );
|
||||
sStrategies.put( Scene.AIMLESS, aimless );
|
||||
}
|
||||
|
||||
// 巡航场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > aimless = new HashMap<>();
|
||||
aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.677734375D, 0.54D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.558737D ) );
|
||||
sStrategies.put( Scene.AIMLESS, aimless );
|
||||
{
|
||||
// 巡航场景 vs 道路事件展示场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>();
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.585 ) );
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.599074074D ) );
|
||||
sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent );
|
||||
}
|
||||
|
||||
{
|
||||
// 规划路线,定位视图右边
|
||||
Map< Integer, MapCenterPoint > calculatePath = new HashMap<>();
|
||||
calculatePath.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
calculatePath.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
||||
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
|
||||
}
|
||||
|
||||
// 规划路线,定位视图右边
|
||||
Map< Integer, MapCenterPoint > calculatePath = new HashMap<>();
|
||||
calculatePath.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
calculatePath.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
||||
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
|
||||
{
|
||||
// 分类搜索,定位视图右边
|
||||
Map< Integer, MapCenterPoint > categorySearch = new HashMap<>();
|
||||
categorySearch.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
categorySearch.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.733594D, 0.596759D ) );
|
||||
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
|
||||
}
|
||||
|
||||
// 分类搜索,定位视图右边
|
||||
Map< Integer, MapCenterPoint > categorySearch = new HashMap<>();
|
||||
categorySearch.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
categorySearch.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.733594D, 0.596759D ) );
|
||||
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
|
||||
|
||||
|
||||
// V2X,场景视图右边
|
||||
Map< Integer, MapCenterPoint > categoryV2XEvent = new HashMap<>();
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) );
|
||||
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
|
||||
{
|
||||
// V2X,场景视图右边
|
||||
Map< Integer, MapCenterPoint > categoryV2XEvent = new HashMap<>();
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) );
|
||||
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
|
||||
}
|
||||
}
|
||||
|
||||
public static void addScene( int scene, Map< Integer, MapCenterPoint > config ) {
|
||||
|
||||
@@ -23,11 +23,21 @@ public interface Scene {
|
||||
*/
|
||||
int NAVI = 2;
|
||||
|
||||
/**
|
||||
* 导航 vs 道路事件
|
||||
*/
|
||||
int NAVI_WITH_ROAD_EVENT = 21;
|
||||
|
||||
/**
|
||||
* 巡航
|
||||
*/
|
||||
int AIMLESS = 3;
|
||||
|
||||
/**
|
||||
* 巡航 vs 道路事件
|
||||
*/
|
||||
int AIMLESS_WITH_ROAD_EVENT = 31;
|
||||
|
||||
/**
|
||||
* 路线规划
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
switch ( msg.what ) {
|
||||
case ServiceConst.MSG_TYPE_REFRESH_DECREASE:
|
||||
if ( mStatusManager.isSearchUIShow() || mStatusManager.isV2XShow() ) {
|
||||
stopAutoRefreshStrategy();
|
||||
invokeAutoRefreshStrategy();
|
||||
return;
|
||||
}
|
||||
mRefreshRemainingTime -= ServiceConst.DECREASE_INTERVAL;
|
||||
@@ -263,17 +263,12 @@ public class MogoServices implements IMogoMapListener,
|
||||
invokeAutoRefreshStrategy();
|
||||
}
|
||||
}
|
||||
|
||||
private void invokeAutoRefreshStrategy() {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
mRefreshRemainingTime = mAutoRefreshStrategy.getInterval();
|
||||
mHandler.removeMessages( ServiceConst.MSG_TYPE_REFRESH_DECREASE );
|
||||
mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_TYPE_REFRESH_DECREASE, ServiceConst.DECREASE_INTERVAL );
|
||||
}
|
||||
};
|
||||
|
||||
private void invokeAutoRefreshStrategy() {
|
||||
restartAutoRefreshAtTime( mAutoRefreshStrategy.getInterval() );
|
||||
}
|
||||
|
||||
private Handler mThreadHandler;
|
||||
|
||||
public void init( Context context ) {
|
||||
@@ -616,7 +611,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新" );
|
||||
int amount = mLastZoomLevel >= 10 ? 5 : 10;
|
||||
int amount = 10;
|
||||
|
||||
Message msg = Message.obtain();
|
||||
msg.what = ServiceConst.MSG_REQUEST_DATA;
|
||||
@@ -697,7 +692,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
public void restartAutoRefreshAtTime( int time ) {
|
||||
public void restartAutoRefreshAtTime( long time ) {
|
||||
if ( time < 0 ) {
|
||||
Logger.w( TAG, "ignore refresh request case time < 0" );
|
||||
return;
|
||||
@@ -716,7 +711,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
Logger.d( TAG, "move to center and refresh data." );
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, false );
|
||||
mUiController.recoverLockMode();// 锁车代替移到中心点
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
restartAutoRefreshAtTime( 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ServiceConst {
|
||||
public static final int DEFAULT_AUTO_REFRESH_DATA_RADIUS = 2_000;
|
||||
|
||||
/**
|
||||
* 20 s
|
||||
* 30 s
|
||||
*/
|
||||
public static final int DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT = 30 * 1_000;
|
||||
|
||||
|
||||
@@ -134,6 +134,15 @@ public class MockIntentHandler implements IntentHandler {
|
||||
case 11:
|
||||
MarkerServiceHandler.getADASController().setSettingStatus( intent.getBooleanExtra( "status", false ) );
|
||||
break;
|
||||
case 12: {
|
||||
boolean status2 = intent.getBooleanExtra( "status", false );
|
||||
if ( status2 ) {
|
||||
MarkerServiceHandler.getADASController().showADAS();
|
||||
} else {
|
||||
MarkerServiceHandler.getADASController().closeADAS();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
*/
|
||||
private void drawAllMarker( MarkerCardResult markerCardResult ) {
|
||||
List< MarkerExploreWay > exploreWayList = markerCardResult.getExploreWay();
|
||||
|
||||
drawRoadConditionMarker( exploreWayList, ServiceConst.MAX_AMOUNT_ALL );
|
||||
}
|
||||
|
||||
|
||||
@@ -70,16 +70,17 @@ public class MogoADASController implements IMogoADASController {
|
||||
init( AbsMogoApplication.getApp() );
|
||||
}
|
||||
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( !mStatusManager.isMainPageOnResume() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ? 0 : 500;
|
||||
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
try {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( !mStatusManager.isMainPageOnResume() ) {
|
||||
return;
|
||||
}
|
||||
AutopilotServiceManage.getInstance().showAdas();
|
||||
} catch ( Exception e ) {
|
||||
Intent intent = new Intent( ACTION );
|
||||
|
||||
Reference in New Issue
Block a user