Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1'
# Conflicts: # modules.txt
This commit is contained in:
1
libraries/map-autonavi/.gitignore
vendored
1
libraries/map-autonavi/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,66 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility 1.8
|
||||
targetCompatibility 1.8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':services:mogo-service-api')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.map
|
||||
POM_ARTIFACT_ID=map-autonavi
|
||||
VERSION_CODE=1
|
||||
21
libraries/map-autonavi/proguard-rules.pro
vendored
21
libraries/map-autonavi/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,13 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.map.impl.automap">
|
||||
|
||||
<application>
|
||||
<receiver
|
||||
android:name=".navi.AutoNaviReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="AUTONAVI_STANDARD_BROADCAST_SEND" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -1,229 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/2
|
||||
* <p>
|
||||
* 使用高德车机版导航
|
||||
*/
|
||||
public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
|
||||
public static final String ACTION_AUTO_MAP = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
public static final String KEY_TYPE = "KEY_TYPE";
|
||||
public static final String SOURCE_APP = "SOURCE_APP";
|
||||
public static final String LAT = "LAT";
|
||||
public static final String LON = "LON";
|
||||
public static final String ENTRY_LAT = "ENTRY_LAT";
|
||||
public static final String ENTRY_LON = "ENTRY_LON";
|
||||
public static final String DEV = "DEV"; // (int)是否偏移(0:lat 和 lon 是已经加密后的,不需要国测加密; 1:需要国测加密)
|
||||
|
||||
/**
|
||||
* (必填)(int)导航方式
|
||||
* =1(避免收费)
|
||||
* =2(多策略算路)
|
||||
* =3 (不走高速)
|
||||
* =4(躲避拥堵)
|
||||
* =5(不走高速且避免收费)
|
||||
* =6(不走高速且躲避拥堵)
|
||||
* =7(躲避收费且躲避拥堵)
|
||||
* =8(不走高速躲避收费和拥堵)
|
||||
* =20 (高速优先)
|
||||
* =24(高速优先且躲避拥堵)
|
||||
* =-1(地图内部设置默认规则)
|
||||
*/
|
||||
public static final String STYLE = "STYLE";
|
||||
|
||||
private static volatile AutoNaviClient sInstance;
|
||||
private final Context mContext;
|
||||
|
||||
private AutoNaviClient( Context context ) {
|
||||
mContext = context.getApplicationContext();
|
||||
}
|
||||
|
||||
public static AutoNaviClient getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AutoNaviClient.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AutoNaviClient( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( KEY_TYPE, 10038 );
|
||||
intent.putExtra( LAT, endPoint.lat );
|
||||
intent.putExtra( LON, endPoint.lon );
|
||||
// intent.putExtra( ENTRY_LAT, endPoint.lat );
|
||||
// intent.putExtra( ENTRY_LON, endPoint.lon );
|
||||
intent.putExtra( DEV, 0 );
|
||||
intent.putExtra( STYLE, -1 );
|
||||
intent.putExtra( SOURCE_APP, "Third App" );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( "KEY_TYPE", 10010 );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
private void sendByIntent( Intent intent ) {
|
||||
intent.setAction( ACTION_AUTO_MAP );
|
||||
intent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
||||
mContext.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
return MapState.getInstance().isNaving();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getNaviConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getCarLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getCarLocation2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
//do not impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
MogoMapApi.getApiBuilder().getNavi( mContext ).setUseExtraGPSData( use );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
MogoMapApi.getApiBuilder().getNavi( mContext ).setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/2
|
||||
* <p>
|
||||
* 高德公版地图透出信息广播接收者
|
||||
*/
|
||||
public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = "AutoNaviReceiver";
|
||||
|
||||
public static final String ACTION_AUTONAVI_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private static AutoNaviReceiver autoNaviReceiver;
|
||||
private static boolean sRegisterFlag = false;
|
||||
|
||||
private static MogoNaviInfo sNaviInfo;
|
||||
private static MogoTraffic sTraffic;
|
||||
|
||||
|
||||
public static void register( Context context ) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction( ACTION_AUTONAVI_SEND );
|
||||
autoNaviReceiver = new AutoNaviReceiver();
|
||||
context.registerReceiver( autoNaviReceiver, filter );
|
||||
sRegisterFlag = true;
|
||||
}
|
||||
|
||||
public static void unregister( Context context ) {
|
||||
if ( autoNaviReceiver != null && sRegisterFlag ) {
|
||||
try {
|
||||
context.unregisterReceiver( autoNaviReceiver );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error. " );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent ) {
|
||||
String action = intent.getAction();
|
||||
|
||||
if ( !TextUtils.equals( ACTION_AUTONAVI_SEND, action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
switch ( keyType ) {
|
||||
case 10001:
|
||||
handleAutoNaviInfo( context, intent );
|
||||
break;
|
||||
case 10019:
|
||||
int state = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
handleMapStatusChanged( state );
|
||||
break;
|
||||
case 10056:
|
||||
String json = intent.getStringExtra( "EXTRA_ROAD_INFO" );
|
||||
SpStorage.setNavigationTarget( json );
|
||||
Logger.d( TAG, json );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 在导航/巡航/模拟导航中auto主动将变化的引导信息发送给第三方系统
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
private void handleAutoNaviInfo( Context context, Intent intent ) {
|
||||
|
||||
int type = intent.getIntExtra( GuideInfoExtraKey.TYPE, -1 );
|
||||
|
||||
int cameraSpeed = intent.getIntExtra( GuideInfoExtraKey.CAMERA_SPEED, 0 );
|
||||
int cameraDisc = intent.getIntExtra( GuideInfoExtraKey.CAMERA_DIST, 0 );
|
||||
int cameraType = intent.getIntExtra( GuideInfoExtraKey.CAMERA_TYPE, 0 );
|
||||
|
||||
if ( type == 0 || type == 1 ) {
|
||||
if ( !MapState.getInstance().isNaving()
|
||||
&& MogoNaviListenerHandler.getInstance().hasDelegateListener() ) {
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
}
|
||||
if ( sNaviInfo == null ) {
|
||||
sNaviInfo = new MogoNaviInfo();
|
||||
}
|
||||
sNaviInfo.setCurrentLimitSpeed( cameraSpeed );
|
||||
sNaviInfo.setCurrentRoadName( intent.getStringExtra( GuideInfoExtraKey.CUR_ROAD_NAME ) );
|
||||
sNaviInfo.setCurrentSpeed( intent.getIntExtra( GuideInfoExtraKey.CUR_SPEED, 0 ) );
|
||||
sNaviInfo.setCurStepRetainDistance( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_DIS, 0 ) );
|
||||
sNaviInfo.setCurStepRetainTime( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_TIME, 0 ) );
|
||||
sNaviInfo.setIconResId( MogoMapApi.getApiBuilder().getResIdByIconType( context, intent.getIntExtra( GuideInfoExtraKey.NEW_ICON, 0 ) ) );
|
||||
sNaviInfo.setNextRoadName( intent.getStringExtra( GuideInfoExtraKey.NEXT_ROAD_NAME ) );
|
||||
sNaviInfo.setPathRetainDistance( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_DIS, 0 ) );
|
||||
sNaviInfo.setPathRetainTime( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_TIME, 0 ) );
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( sNaviInfo );
|
||||
}
|
||||
if ( sTraffic == null ) {
|
||||
sTraffic = new MogoTraffic( MapState.getInstance().isAimless() ? MogoTraffic.TYPE_AIM : MogoTraffic.TYPE_NAVI );
|
||||
}
|
||||
sTraffic.setFromType( MapState.getInstance().isAimless() ? MogoTraffic.TYPE_AIM : MogoTraffic.TYPE_NAVI );
|
||||
sTraffic.setDistance( cameraDisc );
|
||||
sTraffic.setSpeedLimit( cameraSpeed );
|
||||
sTraffic.setTrafficType( cameraType );
|
||||
MogoNaviListenerHandler.getInstance().onUpdateTraffic2( sTraffic );
|
||||
}
|
||||
|
||||
/**
|
||||
* 当导航发生状态变更时,将相应的状态通知给系统。
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void handleMapStatusChanged( int state ) {
|
||||
if ( state == -1 ) {
|
||||
return;
|
||||
}
|
||||
switch ( state ) {
|
||||
case MapStateValue.START_NAVI:
|
||||
case MapStateValue.START_EMULATOR_NAVI:
|
||||
if ( MapState.getInstance().isNaving() ) {
|
||||
Logger.w( TAG, "naving..." );
|
||||
return;
|
||||
}
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
break;
|
||||
case MapStateValue.STOP_NAVI:
|
||||
case MapStateValue.STOP_EMULATOR_NAVI:
|
||||
case MapStateValue.APP_START: // 语音退出导航,感觉是杀掉了高德APP了
|
||||
if ( MapState.getInstance().isNaving() ) {
|
||||
MapState.getInstance().setNaving( false );
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
}
|
||||
break;
|
||||
case MapStateValue.START_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( true );
|
||||
break;
|
||||
case MapStateValue.STOP_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( false );
|
||||
break;
|
||||
case MapStateValue.EXIT_APP:
|
||||
break;
|
||||
case MapStateValue.DESTINATION:
|
||||
MogoNaviListenerHandler.getInstance().onArriveDestination();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
//引导信息对应的KEY值机器描述
|
||||
public class GuideInfoExtraKey {
|
||||
/**
|
||||
* 导航类型,对应的值为int类型
|
||||
* 0:GPS导航
|
||||
* 1:模拟导航
|
||||
* 2:巡航
|
||||
*/
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
/**
|
||||
* 当前道路名称,对应的值为String类型
|
||||
*/
|
||||
public static final String CUR_ROAD_NAME = "CUR_ROAD_NAME";
|
||||
|
||||
/**
|
||||
* 下一道路名,对应的值为String类型
|
||||
*/
|
||||
public static final String NEXT_ROAD_NAME = "NEXT_ROAD_NAME";
|
||||
|
||||
/**
|
||||
* 电子眼限速度,对应的值为int类型,无限速则为0,单位:公里/小时
|
||||
*/
|
||||
public static final String CAMERA_SPEED = "CAMERA_SPEED";
|
||||
|
||||
/**
|
||||
* 导航转向图标,对应的值为int类型
|
||||
*/
|
||||
public static final String ICON = "ICON";
|
||||
|
||||
/**
|
||||
* 导航最新的转向图标,对应的值为int类型
|
||||
*/
|
||||
public static final String NEW_ICON = "NEW_ICON";
|
||||
|
||||
/**
|
||||
* 路径剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_DIS = "ROUTE_REMAIN_DIS";
|
||||
/**
|
||||
* 路径剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_TIME = "ROUTE_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 当前导航段剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String SEG_REMAIN_DIS = "SEG_REMAIN_DIS";
|
||||
|
||||
/**
|
||||
* 当前导航段剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String SEG_REMAIN_TIME = "SEG_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 路径总距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String ROUTE_ALL_DIS = "ROUTE_ALL_DIS";
|
||||
|
||||
/**
|
||||
* 路径总时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String ROUTE_ALL_TIME = "ROUTE_ALL_TIME";
|
||||
|
||||
/**
|
||||
* 当前车速,对应的值为int类型,单位:公里/小时
|
||||
*/
|
||||
public static final String CUR_SPEED = "CUR_SPEED";
|
||||
|
||||
/**
|
||||
* 当前道路类型,对应的值为int类型
|
||||
* 0:高速公路
|
||||
* 1:国道
|
||||
* 2:省道
|
||||
* 3:县道
|
||||
* 4:乡公路
|
||||
* 5:县乡村内部道路
|
||||
* 6:主要大街、城市快速道 * 7:主要道路
|
||||
* 8:次要道路
|
||||
* 9:普通道路
|
||||
* 10:非导航道路
|
||||
*/
|
||||
public static final String ROAD_TYPE = "ROAD_TYPE";
|
||||
|
||||
/**
|
||||
* 路径剩余时间,对应的值为String类型,单位:天/小时/分钟 比如:1天2小时, 21小时30分
|
||||
* 钟(只用于长安)
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_TIME_STRING = "ROUTE_REMAIN_TIME_S TRING";
|
||||
|
||||
/**
|
||||
* 下下个路名名称,对应的值为String类型
|
||||
*/
|
||||
public static final String NEXT_NEXT_ROAD_NAME = "NEXT_NEXT_ROAD_NAME";
|
||||
/**
|
||||
* 下下个路口转向图标,对应的值为int类型
|
||||
*/
|
||||
|
||||
public static final String NEXT_NEXT_TURN_ICON = "NEXT_NEXT_TURN_ICON";
|
||||
|
||||
/**
|
||||
* 距离下下个路口剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String NEXT_SEG_REMAIN_DIS = "NEXT_SEG_REMAIN_DIS";
|
||||
|
||||
/**
|
||||
* 距离下下个路口剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String NEXT_SEG_REMAIN_TIME = "NEXT_SEG_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 距离最近的电子眼距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String CAMERA_DIST = "CAMERA_DIST";
|
||||
|
||||
/**
|
||||
* 电子眼类型,对应的值为int类型
|
||||
* 0 测速摄像头
|
||||
* 1为监控摄像头
|
||||
* 2为闯红灯拍照
|
||||
* 3为违章拍照
|
||||
* 4为公交专用道摄像头
|
||||
* 5为应急车道摄像头
|
||||
* 6为非机动车道拍照
|
||||
*/
|
||||
public static final String CAMERA_TYPE = "CAMERA_TYPE";
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
*
|
||||
* 高德地图状态
|
||||
*/
|
||||
class MapState {
|
||||
|
||||
private static volatile MapState sInstance;
|
||||
|
||||
private MapState() {
|
||||
}
|
||||
|
||||
public static MapState getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapState.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapState();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private boolean isNaving = false;
|
||||
private boolean isAimless = false;
|
||||
|
||||
public boolean isNaving() {
|
||||
return isNaving;
|
||||
}
|
||||
|
||||
public void setNaving( boolean naving ) {
|
||||
isNaving = naving;
|
||||
}
|
||||
|
||||
public boolean isAimless() {
|
||||
return isAimless;
|
||||
}
|
||||
|
||||
public void setAimless( boolean aimless ) {
|
||||
isAimless = aimless;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
* <p>
|
||||
* 高德公版地图状态值
|
||||
*/
|
||||
public interface MapStateValue {
|
||||
|
||||
int START_NAVI = 8;
|
||||
|
||||
int STOP_NAVI = 9;
|
||||
|
||||
int START_EMULATOR_NAVI = 10;
|
||||
|
||||
int STOP_EMULATOR_NAVI = 12;
|
||||
|
||||
int START_AIMLESS_NAVI = 24;
|
||||
|
||||
int STOP_AIMLESS_NAVI = 25;
|
||||
|
||||
int EXIT_APP = 45;
|
||||
|
||||
int DESTINATION = 39;
|
||||
|
||||
int APP_START = 0;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.IMogoMapApiBuilder;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/10
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoMapApi {
|
||||
|
||||
private static IMogoMapApiBuilder sApiBuilder;
|
||||
|
||||
public static IMogoMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (AutoNaviClient.class) {
|
||||
if (sApiBuilder == null) {
|
||||
sApiBuilder = ARouter.getInstance().navigation(IMogoMapApiBuilder.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
|
||||
@@ -70,7 +70,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
-keep class com.mogo.map.impl.custom.AMapUiSettingsWrapper{*;}
|
||||
|
||||
#-----自研地图-----
|
||||
-keepattributes EnclosingMethod
|
||||
@@ -13,5 +12,3 @@
|
||||
|
||||
-keepattributes Exceptions,InnerClasses,...
|
||||
-keep class com.zhidaoauto.map.sdk.open.camera.CameraPosition{ *; }
|
||||
-keep class com.zhidaoauto.map.sdk.open.camera.CameraPosition$B { *; }
|
||||
-keep class com.zhidaoauto.map.sdk.open.camera.CameraPosition$C { *; }
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.impl.custom.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.impl.custom.marker.MarkerWrapperClickHelper;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -21,27 +21,28 @@ import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.impl.custom.navi.NaviClient;
|
||||
import com.mogo.map.impl.custom.utils.MogoMapUtils;
|
||||
import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.impl.custom.utils.PointInterpolatorUtil;
|
||||
import com.mogo.map.impl.custom.utils.ResIdCache;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.abs.MapStatusListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnCameraChangeListener;
|
||||
@@ -128,66 +129,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
MapAutoViewHelper options = mMapView.getMapAutoViewHelper();
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
// 设置是否开启自动黑夜模式切换,默认为false,不自动切换
|
||||
// options.setAutoSwitchStyle(false);
|
||||
// 设置6秒后是否自动锁车
|
||||
// options.setAutoLockCar( false );
|
||||
// 设置路线上的摄像头气泡是否显示
|
||||
// options.setCameraBubbleShow( true );
|
||||
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// 设置自车的图片对象
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(DEFAULT_OPTION.getCarCursorRes()));
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
// options.hiddenDirection();
|
||||
// 黑夜模式
|
||||
// options.setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
|
||||
//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
|
||||
// options.setTrafficBarEnabled( false );
|
||||
// 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
|
||||
// options.setTrafficLayerEnabled( false );
|
||||
// 设置导航界面是否显示路线全览按钮。
|
||||
// options.setRouteListButtonShow( false );
|
||||
// 设置导航状态下屏幕是否一直开启。
|
||||
// options.setScreenAlwaysBright( true );
|
||||
// 设置交通播报是否打开(只适用于驾车导航,需要联网)。
|
||||
// options.setTrafficInfoUpdateEnabled( true );
|
||||
// 设置摄像头播报是否打开(只适用于驾车导航)。
|
||||
// options.setCameraInfoUpdateEnabled( true );
|
||||
// 设置菜单按钮是否在导航界面显示。
|
||||
// options.setSettingMenuEnabled( false );
|
||||
// 设置是否绘制显示交通路况的线路(彩虹线),拥堵-红色,畅通-绿色,缓慢-黄色,未知-蓝色。默认不绘制彩虹线。
|
||||
// options.setTrafficLine( true );
|
||||
// 设置是否绘制牵引线(当前位置到目的地的指引线)。默认不绘制牵引线。
|
||||
// options.setLeaderLineEnabled( -1 );
|
||||
// 设置导航界面UI是否显示。
|
||||
// options.setLayoutVisible( false );
|
||||
// 设置是否自动画路
|
||||
// options.setAutoDrawRoute( false );
|
||||
// 设置是否显示路口放大图(实景图)
|
||||
// options.setRealCrossDisplayShow( false );
|
||||
// 设置是否显示路口放大图(路口模型图)
|
||||
// options.setModeCrossDisplayShow( false );
|
||||
// 设置是否显示道路信息view
|
||||
// options.setLaneInfoShow( false );
|
||||
// 设置是否自动改变缩放等级
|
||||
// options.setAutoChangeZoom( false );
|
||||
// 设置是否自动全览模式,即在算路成功后自动进入全览模式
|
||||
// options.setAutoDisplayOverview( false );
|
||||
// 设置路线转向箭头隐藏和显示
|
||||
// options.setNaviArrowVisible( false );
|
||||
// 通过路线是否自动置灰,仅支持驾车导航
|
||||
// options.setAfterRouteAutoGray( true );
|
||||
// options.setZoom(((int) mDefaultZoomLevel));
|
||||
// options.setPointToCenter( 0.5D, 0.5D );
|
||||
// 2D模式
|
||||
// options.setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_2D);
|
||||
// mMapView.setViewOptions( options );
|
||||
options.setScaleVRMode(true);
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(false);
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
// MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true);
|
||||
}
|
||||
// mMapView.setRouteOverlayVisible( false );
|
||||
// mMapView.setCarOverlayVisible( false );
|
||||
// setUIMode(EnumMapUI.CarUp_2D);
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
@@ -198,7 +149,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapTouchListener(this);
|
||||
mMapView.setOnMapClickListener(this);
|
||||
mMapView.getLocationClient().registerListener(this);
|
||||
// mMapView.getLocationClient().registerGpsListener( this );
|
||||
mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ZOOM);
|
||||
mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ROTATE);
|
||||
mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_3D);
|
||||
@@ -206,18 +156,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapStyleListener(this);
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this);
|
||||
Logger.d(TAG, "styleop - initListeners - setOnMapStyleListener - view %s", mMapView);
|
||||
|
||||
// mMapView.setOnPolylineClickListener( this );
|
||||
// mMapView.setAMapNaviViewListener( this );
|
||||
//
|
||||
// final AMap aMap = mMapView.getMap();
|
||||
// if ( aMap != null ) {
|
||||
// aMap.setOnPOIClickListener( this );
|
||||
// aMap.setOnMapClickListener( this );
|
||||
// aMap.setOnCameraChangeListener( this );
|
||||
// aMap.setOnMyLocationChangeListener( this );
|
||||
// }
|
||||
// AMapMessageManager.getInstance().registerAMapMessageListener( this );
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
@@ -403,24 +341,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
moveToCenter(latLng, true);
|
||||
}
|
||||
|
||||
private void setUIMode(EnumMapUI ui) {
|
||||
this.mCurrentCarUIMode = ui;
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
switch (ui) {
|
||||
case CarUp_2D:
|
||||
case CarUp_3D:
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_CAR);
|
||||
break;
|
||||
case NorthUP_2D:
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
return;
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_NORTH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
Logger.e(TAG, "自研mapView实例为空,请检查");
|
||||
@@ -446,15 +366,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
Logger.d(TAG, "showMyLocation1 %s", visible);
|
||||
|
||||
// 如果是VR模式
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (visible && NaviClient.getInstance(getContext()).isNaviing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 不是VR模式情况强制刷新下
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
if (visible) {
|
||||
@@ -468,9 +384,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
Logger.d(TAG, "showMyLocation %s", "view");
|
||||
if (NaviClient.getInstance(getContext()).isNaviing()) {
|
||||
return;
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
@@ -502,7 +415,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "锁车");
|
||||
// mMapView.getMapAutoViewHelper().setZoom(mLockZoom);
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
mIsCarLocked = true;
|
||||
}
|
||||
@@ -745,9 +657,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
// Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:location");
|
||||
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
|
||||
// Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " AMapViewWrapper-onLocationChanged:mLastLocation");
|
||||
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
|
||||
|
||||
Location sysLocation = new Location(location.getProvider());
|
||||
@@ -771,7 +681,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
|
||||
NaviClient.getInstance(getContext()).syncCarLocation(sysLocation);
|
||||
if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(sysLocation);
|
||||
}
|
||||
if (checkAMapView() && mMapLoaded) {
|
||||
// 地图初始化完成后,每隔5s自动判断当前地图的模式
|
||||
if (mIsFirstLocated) {
|
||||
@@ -793,9 +705,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapClick(@Nullable LonLatPoint lonLatPoint) {
|
||||
if (InterceptorHandler.getInstance().ignoreMapClicked(getContext())) {
|
||||
return;
|
||||
}
|
||||
MogoMapListenerHandler.getInstance().onMapClick(ObjectUtils.fromAMap(lonLatPoint));
|
||||
}
|
||||
|
||||
@@ -809,9 +718,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
Logger.i(TAG, "autoop--onMapLoaded: ");
|
||||
MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true); //修改自车模型,未来需区分车的类型
|
||||
//mMapView.getMapAutoViewHelper().setRenderFrequency(true, 50);// 地图刷新频率
|
||||
//MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
@@ -1015,6 +921,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
// 使用外部定位数据修改自车位置
|
||||
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
|
||||
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1075,26 +982,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
// Log.i("timer-matchRoad-4", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + singlePointRoadInfo.getRoadId());
|
||||
roadCache = new RoadCacheWrapper(singlePointRoadInfo.getCoords());
|
||||
roadCache.setLaneWidth(singlePointRoadInfo.getLaneWidth());
|
||||
// 在地图上画点的测试方法
|
||||
// try {
|
||||
// PolylineOptions options = new PolylineOptions( );
|
||||
// options.setColor( colors[colorIndex++] );
|
||||
// options.setId( "test-line"+new Random( ).nextLong() );
|
||||
// options.setGps( true );
|
||||
// options.setLineWidth( 3 );
|
||||
// List<LonLatPoint> points = singlePointRoadInfo.getCoords();
|
||||
// ArrayList< LonLat > lonLats = new ArrayList<>( );
|
||||
// for ( LonLatPoint point : points ) {
|
||||
// lonLats.add( new LonLat( point.getLongitude(), point.getLatitude() ) );
|
||||
// }
|
||||
// options.setLonLats( lonLats );
|
||||
// mMapView.getMapAutoViewHelper().drawThickLine( options );
|
||||
// if (colorIndex >= colors.length) {
|
||||
// colorIndex = 0;
|
||||
// }
|
||||
// } catch( Exception e ){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1141,4 +1028,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
ResIdCache.putVal(speedVal, val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.impl.custom.marker.AMapInfoWindowAdapter;
|
||||
@@ -17,7 +18,6 @@ import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
@@ -148,11 +148,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 地图导航时,忽略参数
|
||||
if (InterceptorHandler.getInstance().ignoreAddMarkersMoveToCenterParameters(getContext())) {
|
||||
moveToCenter = false;
|
||||
}
|
||||
|
||||
ArrayList<Marker> markers = new ArrayList<>();
|
||||
ArrayList<MarkerOptions> markerOptions = new ArrayList<>();
|
||||
ArrayList<IMogoMarker> mogoMarkers = new ArrayList<>();
|
||||
|
||||
@@ -4,28 +4,22 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.IMogoMapApiBuilder;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.mogo.map.impl.custom.location.ALocationClient;
|
||||
import com.mogo.map.impl.custom.navi.NaviClient;
|
||||
import com.mogo.map.impl.custom.search.GeocodeSearchClient;
|
||||
import com.mogo.map.impl.custom.search.PoiSearchClient;
|
||||
import com.mogo.map.impl.custom.uicontroller.AMapUIController;
|
||||
import com.mogo.map.impl.custom.utils.IconTypeUtils;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.NavAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.NavParams;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
/**
|
||||
@@ -54,37 +48,27 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
return AMapUIController.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNavi getNavi(Context context) {
|
||||
return NaviClient.getInstance(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoPoiSearch getPoiSearchClient(Context context, MogoPoiSearchQuery query) {
|
||||
return new PoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoAimless getAimless(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMogoMapView getMapView(Context context) {
|
||||
Log.d(TAG, "setDebugMode==true");
|
||||
|
||||
MapParams mapParams = MapParams.Companion.init();
|
||||
mapParams.setDebugMode(false)
|
||||
//.setDataFileSource(1) //todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
.setPointToCenter(0.5f, 0.5f) //todo 2D模式下需要注意ADAS部分遮挡
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
.setPointToCenter(0.5f, 0.5f)
|
||||
.setStyleMode(MapParams.MAP_STYLE_VR);
|
||||
|
||||
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
//mapAutoView.registerRenderListener(l -> Log.i(TAG, "renderTime: " + l));
|
||||
@@ -102,11 +86,6 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResIdByIconType(Context context, int iconType) {
|
||||
return IconTypeUtils.getResIdByIconType(context, iconType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "init");
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-27
|
||||
* <p>
|
||||
* 操作拦截器
|
||||
*/
|
||||
public interface IInterceptor {
|
||||
|
||||
/**
|
||||
* 是否忽略添加多个marker时聚拢参数
|
||||
* <p>
|
||||
* 导航时:不需要聚拢
|
||||
*
|
||||
* @return true - 忽略 false - 不忽略
|
||||
*/
|
||||
boolean ignoreAddMarkersMoveToCenterParameters( Context context );
|
||||
|
||||
/**
|
||||
* 导航时,是否响应 poi 点击
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
boolean ignorePoiClicked( Context context );
|
||||
|
||||
/**
|
||||
* 导航时,是否响应地图点击
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
boolean ignoreMapClicked( Context context );
|
||||
|
||||
/**
|
||||
* 请求绘制路线
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
boolean ignoreDrawRouteOverlay( Context context );
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-27
|
||||
* <p>
|
||||
* 操作拦截器
|
||||
*/
|
||||
public class InterceptorHandler implements IInterceptor {
|
||||
|
||||
private static volatile InterceptorHandler sInstance;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private InterceptorHandler() {
|
||||
}
|
||||
|
||||
public static InterceptorHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( InterceptorHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new InterceptorHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
public void init( Context context ) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoreAddMarkersMoveToCenterParameters( Context context ) {
|
||||
return false;//NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignorePoiClicked( Context context ) {
|
||||
return false;//NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoreMapClicked( Context context ) {
|
||||
return false;//NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoreDrawRouteOverlay( Context context ) {
|
||||
return false;//NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@ import android.os.Trace;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.location.MogoLocationListenerRegister;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationClient;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationListener;
|
||||
import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
|
||||
@@ -59,12 +59,6 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
return;
|
||||
}
|
||||
if ( mClient != null ) {
|
||||
// AMapLocationClientOption option = new AMapLocationClientOption();
|
||||
// option.setLocationMode( AMapLocationClientOption.AMapLocationMode.Hight_Accuracy );
|
||||
// option.setNeedAddress( true );
|
||||
// option.setGpsFirst( true );
|
||||
// option.setInterval( interval );
|
||||
// mClient.setLocationOption( option );
|
||||
mClient.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -14,7 +15,6 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerIconViewCreator;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.MarkerAnimationListener;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Animation;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor;
|
||||
|
||||
@@ -1,264 +0,0 @@
|
||||
package com.mogo.map.impl.custom.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.impl.custom.AMapWrapper;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 自研导航
|
||||
*/
|
||||
public class NaviClient implements IMogoNavi {
|
||||
|
||||
/**
|
||||
* 巡航状态控制
|
||||
*/
|
||||
public static final String KEY_AIMLESS_STATUS = "KEY_AIMLESS_STATUS";
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
private final Context mContext;
|
||||
|
||||
private MapAutoViewHelper mAMapNavi;
|
||||
|
||||
/**
|
||||
* 导航策略配置
|
||||
*/
|
||||
|
||||
private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig();
|
||||
|
||||
private static volatile NaviClient sInstance;
|
||||
private boolean mIsRealNavi;
|
||||
|
||||
private Location mCarLocation = new Location("GPS");
|
||||
/**
|
||||
* 巡航模式配置状态
|
||||
*/
|
||||
private boolean mAimlessModeStatus;
|
||||
|
||||
/**
|
||||
* 巡航状态
|
||||
*/
|
||||
private boolean mAimlessStatus;
|
||||
|
||||
private NaviClient(Context context) {
|
||||
mCarLocation.setLongitude(116.97000);
|
||||
mCarLocation.setLatitude(39.97000);
|
||||
mContext = context;
|
||||
mAMapNavi = AMapWrapper.getAMap();
|
||||
}
|
||||
|
||||
public static NaviClient getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (NaviClient.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new NaviClient(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint) {
|
||||
naviTo(endPoint, mMogoNaviConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint, MogoNaviConfig config) {
|
||||
naviTo(endPoint, null, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints) {
|
||||
naviTo(endPoint, wayPoints, mMogoNaviConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints, MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
return;
|
||||
}
|
||||
Logger.i(TAG, "开始规划路径");
|
||||
mMogoNaviConfig = config;
|
||||
if (mMogoNaviConfig == null) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute(MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
return;
|
||||
}
|
||||
mMogoNaviConfig = config;
|
||||
if (mMogoNaviConfig == null) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void startNavi(boolean isRealNavi) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoCalculatePath> getCalculatedStrategies() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoLatLng> getCalculatedPathPos() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction(OnCalculatePathItemClickInteraction lineClickInteraction) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
return mMogoNaviConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode(int mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoLatLng> getNaviPathCoordinates() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if (mCarLocation != null) {
|
||||
synchronized (mCarLocation) {
|
||||
return new MogoLatLng(mCarLocation.getLatitude(), mCarLocation.getLongitude());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
return mCarLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener(IMogoCarLocationChangedListener2 listener) {
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
public void syncCarLocation(Location location) {
|
||||
mCarLocation = location;
|
||||
if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(location);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAMapNavi() {
|
||||
mAMapNavi = AMapWrapper.getAMap();
|
||||
if (mAMapNavi == null) {
|
||||
Logger.e(TAG, "自研导航实例为空!!!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus(boolean open) {
|
||||
this.mAimlessModeStatus = open;
|
||||
SharedPrefsMgr.getInstance(mContext).putBoolean(KEY_AIMLESS_STATUS, open);
|
||||
if (open) {
|
||||
if (!mAimlessStatus) {
|
||||
startAimlessMode();
|
||||
}
|
||||
} else {
|
||||
if (mAimlessStatus) {
|
||||
stopAimlessMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData(boolean use) {
|
||||
Logger.d(TAG, "设置外部gps源状态 %s", use);
|
||||
mAMapNavi.setIsUseExtraGPSData(use);
|
||||
AMapWrapper.getAMap().setMyLocationEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(double lon, double lat, float speed, float accuracy, float bearing, long timestamp) {
|
||||
if (!mAMapNavi.getIsUseExtraGPSData()) {
|
||||
Logger.d(TAG, "拒绝外部GPS数据");
|
||||
return;
|
||||
}
|
||||
Location location = new Location("外部GPS源");
|
||||
location.setLongitude(lon);
|
||||
location.setLatitude(lat);
|
||||
location.setSpeed(speed);
|
||||
location.setAccuracy(accuracy);
|
||||
location.setBearing(bearing);
|
||||
location.setTime(timestamp);
|
||||
//type字段传1时代表WGS84坐标
|
||||
mAMapNavi.setExtraGPSData(2, location);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@ package com.mogo.map.impl.custom.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsListener;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.query.Inputtips;
|
||||
import com.zhidaoauto.map.sdk.open.query.InputtipsListener;
|
||||
import com.zhidaoauto.map.sdk.open.query.InputtipsQuery;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.map.impl.custom.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.custom.utils.ObjectUtils;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
@@ -10,7 +11,6 @@ import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.MogoSearchBound;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.query.OnPoiSearchListener;
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiItem;
|
||||
import com.zhidaoauto.map.sdk.open.query.PoiSearch;
|
||||
|
||||
@@ -374,4 +374,10 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
if (mClient != null) {
|
||||
mClient.setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
package com.mogo.map.impl.custom.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-09-29
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class IconTypeUtils {
|
||||
|
||||
public class IconType {
|
||||
public static final int NONE = 0;
|
||||
public static final int DEFAULT = 1;
|
||||
public static final int LEFT = 2;
|
||||
public static final int RIGHT = 3;
|
||||
public static final int LEFT_FRONT = 4;
|
||||
public static final int RIGHT_FRONT = 5;
|
||||
public static final int LEFT_BACK = 6;
|
||||
public static final int RIGHT_BACK = 7;
|
||||
public static final int LEFT_TURN_AROUND = 8;
|
||||
public static final int STRAIGHT = 9;
|
||||
public static final int ARRIVED_WAYPOINT = 10;
|
||||
public static final int ENTER_ROUNDABOUT = 11;
|
||||
public static final int OUT_ROUNDABOUT = 12;
|
||||
public static final int ARRIVED_SERVICE_AREA = 13;
|
||||
public static final int ARRIVED_TOLLGATE = 14;
|
||||
public static final int ARRIVED_DESTINATION = 15;
|
||||
public static final int ARRIVED_TUNNEL = 16;
|
||||
public static final int ENTRY_LEFT_RING = 17;
|
||||
public static final int LEAVE_LEFT_RING = 18;
|
||||
public static final int U_TURN_RIGHT = 19;
|
||||
public static final int SPECIAL_CONTINUE = 20;
|
||||
public static final int ENTRY_RING_LEFT = 21;
|
||||
public static final int ENTRY_RING_RIGHT = 22;
|
||||
public static final int ENTRY_RING_CONTINUE = 23;
|
||||
public static final int ENTRY_RING_UTURN = 24;
|
||||
public static final int ENTRY_LEFT_RING_LEFT = 25;
|
||||
public static final int ENTRY_LEFT_RING_RIGHT = 26;
|
||||
public static final int ENTRY_LEFT_RING_CONTINUE = 27;
|
||||
public static final int ENTRY_LEFTRINGU_TURN = 28;
|
||||
public static final int CROSSWALK = 29;
|
||||
public static final int OVERPASS = 30;
|
||||
public static final int UNDERPASS = 31;
|
||||
public static final int SQUARE = 32;
|
||||
public static final int PARK = 33;
|
||||
public static final int STAIRCASE = 34;
|
||||
public static final int LIFT = 35;
|
||||
public static final int CABLEWAY = 36;
|
||||
public static final int SKY_CHANNEL = 37;
|
||||
public static final int CHANNEL = 38;
|
||||
public static final int WALK_ROAD = 39;
|
||||
public static final int CRUISE_ROUTE = 40;
|
||||
public static final int SIGHTSEEING_BUSLINE = 41;
|
||||
public static final int SLIDEWAY = 42;
|
||||
public static final int LADDER = 43;
|
||||
public static final int SLOPE = 44;
|
||||
public static final int BRIDGE = 45;
|
||||
public static final int FERRY = 46;
|
||||
public static final int SUBWAY = 47;
|
||||
public static final int ENTER_BUILDING = 48;
|
||||
public static final int LEAVE_BUILDING = 49;
|
||||
public static final int BY_ELEVATOR = 50;
|
||||
public static final int BY_STAIR = 51;
|
||||
public static final int BY_ESCALATOR = 52;
|
||||
public static final int LOW_TRAFFIC_CROSS = 53;
|
||||
public static final int LOW_CROSS = 54;
|
||||
|
||||
public IconType() {
|
||||
}
|
||||
}
|
||||
|
||||
private static SparseArray< String > sIconName = new SparseArray<>();
|
||||
|
||||
static {
|
||||
sIconName.put( IconType.ARRIVED_DESTINATION, "到达目的地" );
|
||||
sIconName.put( IconType.ARRIVED_SERVICE_AREA, "到达服务区" );
|
||||
sIconName.put( IconType.ARRIVED_TOLLGATE, "到达收费站" );
|
||||
sIconName.put( IconType.ARRIVED_TUNNEL, "到达隧道" );
|
||||
sIconName.put( IconType.ARRIVED_WAYPOINT, "到达途经点" );
|
||||
sIconName.put( IconType.BRIDGE, "通过桥" );
|
||||
sIconName.put( IconType.BY_ELEVATOR, "电梯换层" );
|
||||
sIconName.put( IconType.BY_ESCALATOR, "扶梯换层" );
|
||||
sIconName.put( IconType.BY_STAIR, "楼梯换层" );
|
||||
sIconName.put( IconType.CABLEWAY, "通过索道" );
|
||||
sIconName.put( IconType.CHANNEL, "通过通道" );
|
||||
sIconName.put( IconType.CROSSWALK, "通过人行横道" );
|
||||
sIconName.put( IconType.CRUISE_ROUTE, "通过游船路线" );
|
||||
sIconName.put( IconType.DEFAULT, "自车" );
|
||||
sIconName.put( IconType.ENTER_BUILDING, "进入建筑物" );
|
||||
sIconName.put( IconType.ENTER_ROUNDABOUT, "进入环岛" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING, "进入环岛" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_CONTINUE, "绕环岛直行" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_LEFT, "绕环岛左转" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_RIGHT, "绕环岛右转" );
|
||||
sIconName.put( IconType.ENTRY_LEFTRINGU_TURN, "绕环岛调头" );
|
||||
sIconName.put( IconType.ENTRY_RING_CONTINUE, "绕环岛直行" );
|
||||
sIconName.put( IconType.ENTRY_RING_LEFT, "绕环岛左转" );
|
||||
sIconName.put( IconType.ENTRY_RING_RIGHT, "绕环岛右转" );
|
||||
sIconName.put( IconType.ENTRY_RING_UTURN, "绕环岛调头" );
|
||||
sIconName.put( IconType.FERRY, "通过轮渡" );
|
||||
sIconName.put( IconType.LADDER, "通过阶梯" );
|
||||
sIconName.put( IconType.LEAVE_BUILDING, "离开建筑物" );
|
||||
sIconName.put( IconType.LEAVE_LEFT_RING, "驶出环岛" );
|
||||
sIconName.put( IconType.LEFT, "左转" );
|
||||
sIconName.put( IconType.LEFT_BACK, "左后" );
|
||||
sIconName.put( IconType.LEFT_FRONT, "左前方" );
|
||||
sIconName.put( IconType.LEFT_TURN_AROUND, "左转掉头" );
|
||||
sIconName.put( IconType.LIFT, "通过直梯" );
|
||||
sIconName.put( IconType.LOW_CROSS, "通过普通路口" );
|
||||
sIconName.put( IconType.LOW_TRAFFIC_CROSS, "红绿灯路口" );
|
||||
sIconName.put( IconType.NONE, "无定义" );
|
||||
sIconName.put( IconType.OUT_ROUNDABOUT, "驶出环岛" );
|
||||
sIconName.put( IconType.OVERPASS, "通过过街天桥" );
|
||||
sIconName.put( IconType.PARK, "通过公园" );
|
||||
sIconName.put( IconType.RIGHT, "右转" );
|
||||
sIconName.put( IconType.RIGHT_BACK, "右后方" );
|
||||
sIconName.put( IconType.RIGHT_FRONT, "右前方" );
|
||||
sIconName.put( IconType.SIGHTSEEING_BUSLINE, "通过观光车路线" );
|
||||
sIconName.put( IconType.SKY_CHANNEL, "通过空中通道" );
|
||||
sIconName.put( IconType.SLIDEWAY, "通过滑道" );
|
||||
sIconName.put( IconType.SLOPE, "通过斜坡" );
|
||||
sIconName.put( IconType.SPECIAL_CONTINUE, "顺行" );
|
||||
sIconName.put( IconType.SQUARE, "通过广场" );
|
||||
sIconName.put( IconType.STAIRCASE, "通过扶梯" );
|
||||
sIconName.put( IconType.STRAIGHT, "直行" );
|
||||
sIconName.put( IconType.SUBWAY, "通过地铁通道" );
|
||||
sIconName.put( IconType.U_TURN_RIGHT, "右转掉头" );
|
||||
sIconName.put( IconType.UNDERPASS, "通过地下通道" );
|
||||
sIconName.put( IconType.WALK_ROAD, "通过行人道路" );
|
||||
}
|
||||
|
||||
private static int lastIconType = 0;
|
||||
private static int lastIconResId = 0;
|
||||
|
||||
public static String getNameByIconType( int iconType ) {
|
||||
return sIconName.get( iconType );
|
||||
}
|
||||
|
||||
public static int getResIdByIconType( Context context, int iconType ) {
|
||||
try {
|
||||
if ( iconType == lastIconType ) {
|
||||
return lastIconResId;
|
||||
}
|
||||
int target = context.getResources().getIdentifier( "ic_" + iconType, "drawable", context.getPackageName() );
|
||||
lastIconType = iconType;
|
||||
lastIconResId = target;
|
||||
return target;
|
||||
} catch ( Exception e ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,10 +88,12 @@ public class ObjectUtils {
|
||||
.zIndex(opt.getzIndex());
|
||||
|
||||
try {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
if (!TextUtils.isEmpty(opt.getAnchorColor())) {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
}
|
||||
markerOptions.vrEnable(opt.is3DMode());
|
||||
if (!TextUtils.isEmpty(opt.getResName())) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.map.impl.custom.utils;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -49,11 +49,10 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
@@ -27,17 +25,12 @@ interface IMogoMapApiBuilder extends IProvider {
|
||||
|
||||
IMogoMapUIController getMapUIController();
|
||||
|
||||
IMogoNavi getNavi( Context context );
|
||||
|
||||
IMogoPoiSearch getPoiSearchClient( Context context, MogoPoiSearchQuery query );
|
||||
|
||||
IMogoAimless getAimless( Context context );
|
||||
|
||||
void destroy();
|
||||
|
||||
IMogoMapView getMapView( Context context );
|
||||
|
||||
IMogoTrafficSearch getTrafficSearch();
|
||||
|
||||
int getResIdByIconType( Context context, int iconType );
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 地图抽象
|
||||
*/
|
||||
public interface IMogoMapViewCreator {
|
||||
|
||||
IMogoMapView create( Context context);
|
||||
}
|
||||
@@ -7,8 +7,6 @@ import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.map.listener;
|
||||
|
||||
import com.mogo.map.marker.IMogoMarkerClickListenerRegister;
|
||||
import com.mogo.map.navi.IMogoNaviListenerRegister;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -9,7 +8,7 @@ import com.mogo.map.navi.IMogoNaviListenerRegister;
|
||||
* <p>
|
||||
* 主模块需要注册监听的事件
|
||||
*/
|
||||
public interface IMogoHosListenerRegister extends IMogoNaviListenerRegister,
|
||||
public interface IMogoHosListenerRegister extends
|
||||
IMogoMapListenerRegister,
|
||||
IMogoMarkerClickListenerRegister {
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.mogo.map.listener;
|
||||
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.map.navi.IMogoAimlessModeListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -45,16 +42,6 @@ public class MogoHosListenerRegister implements IMogoHosListenerRegister {
|
||||
MogoMapListenerHandler.getInstance().unregisterHostMapListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHostNaviListener( IMogoNaviListener listener ) {
|
||||
MogoNaviListenerHandler.getInstance().registerHostNaviListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostNaviListener() {
|
||||
MogoNaviListenerHandler.getInstance().unregisterHostNaviListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
MogoMarkersHandler.getInstance().registerMarkerClickListener( listener );
|
||||
@@ -65,13 +52,4 @@ public class MogoHosListenerRegister implements IMogoHosListenerRegister {
|
||||
MogoMarkersHandler.getInstance().unregisterMarkerClickListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHostAimlessModeListener( IMogoAimlessModeListener listener ) {
|
||||
MogoNaviListenerHandler.getInstance().registerHostAimlessModeListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostAimlessModeListener() {
|
||||
MogoNaviListenerHandler.getInstance().unregisterHostAimlessModeListener();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ public class MogoMarkerOptions extends Observable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoMarkerOptions object( Object object ) {
|
||||
public MogoMarkerOptions data(Object object ) {
|
||||
this.mObject = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @since 2020-11-05
|
||||
* <p>
|
||||
* 巡航操作
|
||||
*/
|
||||
public interface IMogoAimless {
|
||||
|
||||
/**
|
||||
* 打开巡航模式
|
||||
*/
|
||||
void startAimlessMode();
|
||||
|
||||
/**
|
||||
* 关闭巡航模式
|
||||
*/
|
||||
void stopAimlessMode();
|
||||
|
||||
/**
|
||||
* 设置巡航模式状态
|
||||
*
|
||||
* @param open
|
||||
*/
|
||||
void setAimlessModeStatus(boolean open);
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-09
|
||||
* <p>
|
||||
* 续航模式回调
|
||||
*/
|
||||
public interface IMogoAimlessModeListener {
|
||||
|
||||
/**
|
||||
* 巡航信息发生改变
|
||||
*/
|
||||
default void onUpdateTraffic2( MogoTraffic traffic ){}
|
||||
|
||||
/**
|
||||
* 拥堵信息
|
||||
*
|
||||
* @param info
|
||||
*/
|
||||
default void onUpdateCongestion( MogoCongestionInfo info ){}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-14
|
||||
@@ -11,5 +9,4 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
*/
|
||||
public interface IMogoCarLocationChangedListener {
|
||||
|
||||
void onCarLocationChanged( MogoLatLng latLng );
|
||||
}
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航操作
|
||||
*/
|
||||
public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMogoOperationListenerRegister{
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
* @param endPoint 目的地
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint );
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
* @param endPoint 目的地
|
||||
* @param config 规划路线策略
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
* @param endPoint 导航目的地
|
||||
* @param wayPoints 途经点
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints );
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
* @param endPoint 导航目的地
|
||||
* @param wayPoints 途经点
|
||||
* @param config 规划路线策略
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 重新算路
|
||||
*
|
||||
* @param config 规划路线策略
|
||||
*/
|
||||
void reCalculateRoute( MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 退出导航
|
||||
*/
|
||||
void stopNavi();
|
||||
|
||||
/**
|
||||
* 开始导航
|
||||
*
|
||||
* @param isRealNavi true - 实时导航 false - 模拟导航
|
||||
*/
|
||||
void startNavi( boolean isRealNavi );
|
||||
|
||||
/**
|
||||
* 是否正在导航
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isNaviing();
|
||||
|
||||
/**
|
||||
* 获取路线规划策略
|
||||
*
|
||||
* @return 规划的路线
|
||||
*/
|
||||
List< MogoCalculatePath > getCalculatedStrategies();
|
||||
|
||||
|
||||
/**
|
||||
* 获取路线坐标点
|
||||
*
|
||||
* @return 规划的路线上所有的坐标点
|
||||
*/
|
||||
List< MogoLatLng > getCalculatedPathPos();
|
||||
|
||||
|
||||
/**
|
||||
* 获取列表Item点击回调
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
OnCalculatePathItemClickInteraction getItemClickInteraction();
|
||||
|
||||
/**
|
||||
* 清除规划的路线
|
||||
*/
|
||||
void clearCalculatePaths();
|
||||
|
||||
/**
|
||||
* 设置显示规划路线的范围
|
||||
*
|
||||
* @param bounds 范围
|
||||
*/
|
||||
void setCalculatePathDisplayBounds( Rect bounds );
|
||||
|
||||
/**
|
||||
* 导航配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoNaviConfig getNaviConfig();
|
||||
|
||||
/**
|
||||
* 设置播报模式
|
||||
*
|
||||
* @param mode
|
||||
* @return
|
||||
*/
|
||||
boolean setBroadcastMode( int mode );
|
||||
|
||||
/**
|
||||
* 获取导航沿途路线的点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List< MogoLatLng > getNaviPathCoordinates();
|
||||
|
||||
/**
|
||||
* 获取车标经纬度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getCarLocation();
|
||||
|
||||
/**
|
||||
* 获取车标经纬度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Location getCarLocation2();
|
||||
|
||||
/**
|
||||
* 打开巡航模式
|
||||
*/
|
||||
void startAimlessMode();
|
||||
|
||||
/**
|
||||
* 关闭巡航模式
|
||||
*/
|
||||
void stopAimlessMode();
|
||||
|
||||
/**
|
||||
* 设置巡航模式状态
|
||||
*
|
||||
* @param open
|
||||
*/
|
||||
void setAimlessModeStatus( boolean open );
|
||||
|
||||
/**
|
||||
* 查看全程
|
||||
*/
|
||||
void displayOverview( Rect bounds );
|
||||
|
||||
/**
|
||||
* 设置使用外部定位源
|
||||
*
|
||||
* @param use true - 使用,false - 不适用
|
||||
*/
|
||||
void setUseExtraGPSData( boolean use );
|
||||
|
||||
/**
|
||||
* 设置外部数据源
|
||||
*/
|
||||
void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp );
|
||||
}
|
||||
@@ -45,10 +45,4 @@ public interface IMogoNaviListener {
|
||||
*/
|
||||
default void onoCalculateFailed(){}
|
||||
|
||||
/**
|
||||
* 巡航信息发生改变
|
||||
* Deprecated, use {@link IMogoAimlessModeListener#onUpdateTraffic2(MogoTraffic)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
default void onUpdateTraffic( MogoTraffic traffic ){}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航监听:区分导航结束
|
||||
*/
|
||||
public interface IMogoNaviListener2 extends IMogoNaviListener {
|
||||
|
||||
/**
|
||||
* 实际导航结束
|
||||
*/
|
||||
default void onArriveDestination() { }
|
||||
|
||||
/**
|
||||
* 模拟导航结束
|
||||
*/
|
||||
default void onEndEmulatorNavi(){}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 地图操作回调
|
||||
*/
|
||||
public interface IMogoNaviListenerRegister {
|
||||
|
||||
/**
|
||||
* 注册导航回调,各业务模块不用关注
|
||||
*
|
||||
* @param listener 回调函数
|
||||
*/
|
||||
void registerHostNaviListener( IMogoNaviListener listener );
|
||||
|
||||
/**
|
||||
* 注册巡航模式回调,各业务模块不用关注
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerHostAimlessModeListener( IMogoAimlessModeListener listener );
|
||||
|
||||
/**
|
||||
* 注销导航回调,各业务模块不用关注
|
||||
*/
|
||||
void unregisterHostNaviListener();
|
||||
|
||||
/**
|
||||
* 注销巡航回调,各业务模块不用关注
|
||||
*/
|
||||
void unregisterHostAimlessModeListener();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface IMogoOperationListenerRegister {
|
||||
|
||||
/**
|
||||
* 设置线条点击回调
|
||||
*/
|
||||
void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction );
|
||||
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-08
|
||||
* <p>
|
||||
* 规划路线信息
|
||||
*/
|
||||
public class MogoCalculatePath {
|
||||
|
||||
/**
|
||||
* 策略名称
|
||||
*/
|
||||
private String mStrategyName;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private String mFormattedTime;
|
||||
private int mTime;
|
||||
|
||||
/**
|
||||
* 距离
|
||||
*/
|
||||
private String mFormattedDistance;
|
||||
private int mDistance;
|
||||
|
||||
/**
|
||||
* 红绿灯个数
|
||||
*/
|
||||
private int mTrafficLights;
|
||||
|
||||
/**
|
||||
* 路线ID,用于选择那一条线
|
||||
*/
|
||||
private String mTagId;
|
||||
|
||||
/**
|
||||
* 规划的线路ID
|
||||
*/
|
||||
private int mPathId;
|
||||
|
||||
|
||||
private List<MogoLatLng> coordList;
|
||||
|
||||
public List<MogoLatLng> getCoordList() {
|
||||
return coordList;
|
||||
}
|
||||
|
||||
public void setCoordList(List<MogoLatLng> coordList) {
|
||||
this.coordList = coordList;
|
||||
}
|
||||
|
||||
public MogoCalculatePath() {
|
||||
}
|
||||
|
||||
public String getStrategyName() {
|
||||
if (!TextUtils.isEmpty(mStrategyName)&&mStrategyName.contains(",")) {
|
||||
String[] split = mStrategyName.split(",");
|
||||
return split[0];
|
||||
}
|
||||
|
||||
return mStrategyName;
|
||||
}
|
||||
|
||||
public void setStrategyName( String mStrategyName ) {
|
||||
this.mStrategyName = mStrategyName;
|
||||
}
|
||||
|
||||
public String getFormattedTime() {
|
||||
return mFormattedTime;
|
||||
}
|
||||
|
||||
public void setFormattedTime( String mTime ) {
|
||||
this.mFormattedTime = mTime;
|
||||
}
|
||||
|
||||
public String getFormattedDistance() {
|
||||
return mFormattedDistance;
|
||||
}
|
||||
|
||||
public void setFormattedDistance( String mDistance ) {
|
||||
this.mFormattedDistance = mDistance;
|
||||
}
|
||||
|
||||
public int getTrafficLights() {
|
||||
return mTrafficLights;
|
||||
}
|
||||
|
||||
public void setTrafficLights( int mTrafficLights ) {
|
||||
this.mTrafficLights = mTrafficLights;
|
||||
}
|
||||
|
||||
|
||||
private StringBuilder mDescBuilder = null;
|
||||
|
||||
public String getDesc() {
|
||||
if ( mDescBuilder == null ) {
|
||||
mDescBuilder = new StringBuilder();
|
||||
int lightsSize = getTrafficLights();
|
||||
if ( lightsSize > 0 ) {
|
||||
mDescBuilder.append( "红绿灯" ).append( lightsSize ).append( "个" );
|
||||
}
|
||||
//mDescBuilder.append( " " );
|
||||
//mDescBuilder.append( "收费" ).append( mPath.getTollCost() ).append( "元" );
|
||||
}
|
||||
|
||||
return mDescBuilder.toString();
|
||||
}
|
||||
|
||||
public String getTagId() {
|
||||
return mTagId;
|
||||
}
|
||||
|
||||
public void setTagId( String mTagId ) {
|
||||
this.mTagId = mTagId;
|
||||
}
|
||||
|
||||
public int getPathId() {
|
||||
return mPathId;
|
||||
}
|
||||
|
||||
public void setPathId( int mPathId ) {
|
||||
this.mPathId = mPathId;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return mTime;
|
||||
}
|
||||
|
||||
public MogoCalculatePath setTime( int time ) {
|
||||
this.mTime = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return mDistance;
|
||||
}
|
||||
|
||||
public MogoCalculatePath setDistance( int distance ) {
|
||||
this.mDistance = distance;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-09
|
||||
* <p>
|
||||
* 拥堵详情
|
||||
*/
|
||||
public class MogoCongestionInfo implements Parcelable {
|
||||
|
||||
private int mTime;
|
||||
private int mLength;
|
||||
private String mRoadName;
|
||||
private int mCongestionStatus;
|
||||
private int mEventType;
|
||||
private double mEventLon;
|
||||
private double mEventLat;
|
||||
|
||||
private List< MogoCongestionLink > mCongestionLinks;
|
||||
|
||||
|
||||
public MogoCongestionInfo() {
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return mTime;
|
||||
}
|
||||
|
||||
public void setTime( int mTime ) {
|
||||
this.mTime = mTime;
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return mLength;
|
||||
}
|
||||
|
||||
public void setLength( int mLength ) {
|
||||
this.mLength = mLength;
|
||||
}
|
||||
|
||||
public String getRoadName() {
|
||||
return mRoadName;
|
||||
}
|
||||
|
||||
public void setRoadName( String mRoadName ) {
|
||||
this.mRoadName = mRoadName;
|
||||
}
|
||||
|
||||
public int getCongestionStatus() {
|
||||
return mCongestionStatus;
|
||||
}
|
||||
|
||||
public void setCongestionStatus( int mCongestionStatus ) {
|
||||
this.mCongestionStatus = mCongestionStatus;
|
||||
}
|
||||
|
||||
public int getEventType() {
|
||||
return mEventType;
|
||||
}
|
||||
|
||||
public void setEventType( int mEventType ) {
|
||||
this.mEventType = mEventType;
|
||||
}
|
||||
|
||||
public double getEventLon() {
|
||||
return mEventLon;
|
||||
}
|
||||
|
||||
public void setEventLon( double mEventLon ) {
|
||||
this.mEventLon = mEventLon;
|
||||
}
|
||||
|
||||
public double getEventLat() {
|
||||
return mEventLat;
|
||||
}
|
||||
|
||||
public void setEventLat( double mEventLat ) {
|
||||
this.mEventLat = mEventLat;
|
||||
}
|
||||
|
||||
public List< MogoCongestionLink > getCongestionLinks() {
|
||||
return mCongestionLinks;
|
||||
}
|
||||
|
||||
public void setCongestionLinks( List< MogoCongestionLink > mCongestionLinks ) {
|
||||
this.mCongestionLinks = mCongestionLinks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeInt( this.mTime );
|
||||
dest.writeInt( this.mLength );
|
||||
dest.writeString( this.mRoadName );
|
||||
dest.writeInt( this.mCongestionStatus );
|
||||
dest.writeInt( this.mEventType );
|
||||
dest.writeDouble( this.mEventLon );
|
||||
dest.writeDouble( this.mEventLat );
|
||||
dest.writeTypedList( this.mCongestionLinks );
|
||||
}
|
||||
|
||||
protected MogoCongestionInfo( Parcel in ) {
|
||||
this.mTime = in.readInt();
|
||||
this.mLength = in.readInt();
|
||||
this.mRoadName = in.readString();
|
||||
this.mCongestionStatus = in.readInt();
|
||||
this.mEventType = in.readInt();
|
||||
this.mEventLon = in.readDouble();
|
||||
this.mEventLat = in.readDouble();
|
||||
this.mCongestionLinks = in.createTypedArrayList( MogoCongestionLink.CREATOR );
|
||||
}
|
||||
|
||||
public static final Creator< MogoCongestionInfo > CREATOR = new Creator< MogoCongestionInfo >() {
|
||||
@Override
|
||||
public MogoCongestionInfo createFromParcel( Parcel source ) {
|
||||
return new MogoCongestionInfo( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoCongestionInfo[] newArray( int size ) {
|
||||
return new MogoCongestionInfo[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoCongestionLink implements Parcelable {
|
||||
|
||||
private ArrayList< MogoLatLng > mCoords;
|
||||
private int mCongestionStatus;
|
||||
|
||||
|
||||
public MogoCongestionLink() {
|
||||
}
|
||||
|
||||
public List< MogoLatLng > getCoords() {
|
||||
return mCoords;
|
||||
}
|
||||
|
||||
public void setCoords( ArrayList< MogoLatLng > mCoords ) {
|
||||
this.mCoords = mCoords;
|
||||
}
|
||||
|
||||
public int getCongestionStatus() {
|
||||
return mCongestionStatus;
|
||||
}
|
||||
|
||||
public void setCongestionStatus( int mCongestionStatus ) {
|
||||
this.mCongestionStatus = mCongestionStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeTypedList( this.mCoords );
|
||||
dest.writeInt( this.mCongestionStatus );
|
||||
}
|
||||
|
||||
protected MogoCongestionLink( Parcel in ) {
|
||||
this.mCoords = in.createTypedArrayList( MogoLatLng.CREATOR );
|
||||
this.mCongestionStatus = in.readInt();
|
||||
}
|
||||
|
||||
public static final Creator< MogoCongestionLink > CREATOR = new Creator< MogoCongestionLink >() {
|
||||
@Override
|
||||
public MogoCongestionLink createFromParcel( Parcel source ) {
|
||||
return new MogoCongestionLink( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoCongestionLink[] newArray( int size ) {
|
||||
return new MogoCongestionLink[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航参数
|
||||
*/
|
||||
public class MogoNaviConfig {
|
||||
|
||||
/**
|
||||
* 是否躲避拥堵
|
||||
*/
|
||||
private boolean congestion = false;
|
||||
|
||||
/**
|
||||
* 不走高速
|
||||
*/
|
||||
private boolean avoidSpeed = false;
|
||||
|
||||
/**
|
||||
* 避免收费
|
||||
*/
|
||||
private boolean cost = false;
|
||||
|
||||
/**
|
||||
* 高速优先
|
||||
*/
|
||||
private boolean highSpeed = false;
|
||||
|
||||
/**
|
||||
* 是否多路线算路
|
||||
*/
|
||||
private boolean multipleRoute = true;
|
||||
|
||||
/**
|
||||
* 是否躲避拥堵
|
||||
*/
|
||||
public MogoNaviConfig congestion( boolean congestion ) {
|
||||
this.congestion = congestion;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 不走高速
|
||||
*/
|
||||
public MogoNaviConfig avoidSpeed( boolean avoidSpeed ) {
|
||||
this.avoidSpeed = avoidSpeed;
|
||||
if (avoidSpeed) {
|
||||
this.highSpeed = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 避免收费
|
||||
*/
|
||||
public MogoNaviConfig cost( boolean cost ) {
|
||||
this.cost = cost;
|
||||
if (cost) {
|
||||
this.highSpeed = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高速优先
|
||||
*/
|
||||
public MogoNaviConfig highSpeed( boolean highSpeed ) {
|
||||
this.highSpeed = highSpeed;
|
||||
if (highSpeed) {
|
||||
this.avoidSpeed = false;
|
||||
this.cost = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否多路线算路
|
||||
*/
|
||||
public MogoNaviConfig multipleRoute( boolean multipleRoute ) {
|
||||
this.multipleRoute = multipleRoute;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCongestion() {
|
||||
return congestion;
|
||||
}
|
||||
|
||||
public boolean isAvoidSpeed() {
|
||||
return avoidSpeed;
|
||||
}
|
||||
|
||||
public boolean isCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public boolean isHighSpeed() {
|
||||
return highSpeed;
|
||||
}
|
||||
|
||||
public boolean isMultipleRoute() {
|
||||
return multipleRoute;
|
||||
}
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 地图监听注册管理
|
||||
*/
|
||||
public class MogoNaviListenerHandler implements IMogoNaviListener2, IMogoNaviListenerRegister, IMogoAimlessModeListener {
|
||||
|
||||
private static volatile MogoNaviListenerHandler sInstance;
|
||||
|
||||
private MogoNaviListenerHandler() {
|
||||
}
|
||||
|
||||
public static MogoNaviListenerHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoNaviListenerHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoNaviListenerHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上层模块代理对象
|
||||
*/
|
||||
private IMogoNaviListener mDelegateListener = null;
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public boolean hasDelegateListener(){
|
||||
return mDelegateListener != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上层模块代理对象
|
||||
*/
|
||||
private IMogoAimlessModeListener mAimlessDelegateListener = null;
|
||||
|
||||
@Override
|
||||
public void registerHostNaviListener( IMogoNaviListener listener ) {
|
||||
mDelegateListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostNaviListener() {
|
||||
mDelegateListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHostAimlessModeListener( IMogoAimlessModeListener listener ) {
|
||||
mAimlessDelegateListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterHostAimlessModeListener() {
|
||||
mAimlessDelegateListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onInitNaviFailure() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onInitNaviFailure();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onInitNaviSuccess() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onInitNaviSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onNaviInfoUpdate( naviinfo );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onStartNavi() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onStartNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onStopNavi() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onStopNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onCalculateSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoCalculateFailed() {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onoCalculateFailed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
if ( mDelegateListener != null ) {
|
||||
mDelegateListener.onUpdateTraffic( traffic );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic2( MogoTraffic traffic ) {
|
||||
if ( mAimlessDelegateListener != null ) {
|
||||
mAimlessDelegateListener.onUpdateTraffic2( traffic );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateCongestion( MogoCongestionInfo info ) {
|
||||
if ( mAimlessDelegateListener != null ) {
|
||||
mAimlessDelegateListener.onUpdateCongestion( info );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveDestination() {
|
||||
if ( mDelegateListener instanceof IMogoNaviListener2 ) {
|
||||
( ( IMogoNaviListener2 ) mDelegateListener ).onArriveDestination();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndEmulatorNavi() {
|
||||
if ( mDelegateListener instanceof IMogoNaviListener2 ) {
|
||||
( ( IMogoNaviListener2 ) mDelegateListener ).onEndEmulatorNavi();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MogoOperationListenerRegister implements IMogoOperationListenerRegister {
|
||||
|
||||
private static volatile MogoOperationListenerRegister sInstance;
|
||||
private OnCalculatePathItemClickInteraction itemClickInteraction;
|
||||
|
||||
private MogoOperationListenerRegister(){}
|
||||
|
||||
public static MogoOperationListenerRegister getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( MogoOperationListenerRegister.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new MogoOperationListenerRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置线条点击回调
|
||||
*/
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
this.itemClickInteraction = itemClickInteraction;
|
||||
}
|
||||
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
return itemClickInteraction;
|
||||
}
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-16
|
||||
* <p>
|
||||
* 巡航信息、导航信息
|
||||
*/
|
||||
public class MogoTraffic {
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
public static final int TYPE_NAVI = 1;
|
||||
|
||||
/**
|
||||
* 巡航
|
||||
*/
|
||||
public static final int TYPE_AIM = 2;
|
||||
|
||||
/**
|
||||
* 导航 or 巡航
|
||||
*/
|
||||
private int mFromType;
|
||||
|
||||
/**
|
||||
* 距离
|
||||
*/
|
||||
private int mDistance;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
private int mSpeedLimit;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private double mLon;
|
||||
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
private double mLat;
|
||||
|
||||
/**
|
||||
* 交通类型
|
||||
* 0 未知道路设施
|
||||
* 4 测速摄像头、测速雷达
|
||||
* 5 违章摄像头
|
||||
* 10 请谨慎驾驶
|
||||
* 11 有连续拍照
|
||||
* 12 铁路道口
|
||||
* 13 注意落石(左侧)
|
||||
* 14 事故易发地段
|
||||
* 15 易滑
|
||||
* 16 村庄
|
||||
* 18 前方学校
|
||||
* 19 有人看管的铁路道口
|
||||
* 20 无人看管的铁路道口
|
||||
* 21 两侧变窄
|
||||
* 22 向左急弯路
|
||||
* 23 向右急弯路
|
||||
* 24 反向弯路
|
||||
* 25 连续弯路
|
||||
* 26 左侧合流标识牌
|
||||
* 27 右侧合流标识牌
|
||||
* 28 监控摄像头
|
||||
* 29 专用道摄像头
|
||||
* 31 禁止超车
|
||||
* 36 右侧变窄
|
||||
* 37 左侧变窄
|
||||
* 38 窄桥
|
||||
* 39 左右绕行
|
||||
* 40 左侧绕行
|
||||
* 41 右侧绕行
|
||||
* 42 注意落石(右侧)
|
||||
* 43 傍山险路(左侧)
|
||||
* 44 傍山险路(右侧)
|
||||
* 47 上陡坡
|
||||
* 48 下陡坡
|
||||
* 49 过水路面
|
||||
* 50 路面不平
|
||||
* 52 慢行
|
||||
* 53 注意危险
|
||||
* 58 隧道
|
||||
* 59 渡口
|
||||
* 92 闯红灯
|
||||
* 93 应急车道
|
||||
* 94 非机动车道
|
||||
* 100 不绑定电子眼高发地
|
||||
* 101 车道违章
|
||||
* 102 超速违章
|
||||
*/
|
||||
private int mTrafficType;
|
||||
|
||||
public MogoTraffic( int fromType ) {
|
||||
mFromType = fromType;
|
||||
}
|
||||
|
||||
public int getFromType() {
|
||||
return mFromType;
|
||||
}
|
||||
|
||||
public void setFromType( int fromType ) {
|
||||
this.mFromType = fromType;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return mDistance;
|
||||
}
|
||||
|
||||
public void setDistance( int distance ) {
|
||||
this.mDistance = distance;
|
||||
}
|
||||
|
||||
public int getSpeedLimit() {
|
||||
return mSpeedLimit < 0 ? 0 : mSpeedLimit;
|
||||
}
|
||||
|
||||
public void setSpeedLimit( int speedLimit ) {
|
||||
this.mSpeedLimit = speedLimit;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
switch ( getTrafficType() ) {
|
||||
case 0:
|
||||
default:
|
||||
return "未知道路设施";
|
||||
case 4:
|
||||
return "测速摄像头、测速雷达";
|
||||
case 5:
|
||||
return "违章摄像头";
|
||||
case 10:
|
||||
return "请谨慎驾驶";
|
||||
case 11:
|
||||
return "有连续拍照";
|
||||
case 12:
|
||||
return "铁路道口";
|
||||
case 13:
|
||||
return "注意落石(左侧)";
|
||||
case 14:
|
||||
return "事故易发地段";
|
||||
case 15:
|
||||
return "易滑";
|
||||
case 16:
|
||||
return "村庄";
|
||||
case 18:
|
||||
return "前方学校";
|
||||
case 19:
|
||||
return "有人看管的铁路道口";
|
||||
case 20:
|
||||
return "无人看管的铁路道口";
|
||||
case 21:
|
||||
return "两侧变窄";
|
||||
case 22:
|
||||
return "向左急弯路";
|
||||
case 23:
|
||||
return "向右急弯路";
|
||||
case 24:
|
||||
return "反向弯路";
|
||||
case 25:
|
||||
return "连续弯路";
|
||||
case 26:
|
||||
return "左侧合流标识牌";
|
||||
case 27:
|
||||
return "右侧合流标识牌";
|
||||
case 28:
|
||||
return "监控摄像头";
|
||||
case 29:
|
||||
return "专用道摄像头";
|
||||
case 31:
|
||||
return "禁止超车";
|
||||
case 36:
|
||||
return "右侧变窄";
|
||||
case 37:
|
||||
return "左侧变窄";
|
||||
case 38:
|
||||
return "窄桥";
|
||||
case 39:
|
||||
return "左右绕行";
|
||||
case 40:
|
||||
return "左侧绕行";
|
||||
case 41:
|
||||
return "右侧绕行";
|
||||
case 42:
|
||||
return "注意落石(右侧)";
|
||||
case 43:
|
||||
return "傍山险路(左侧)";
|
||||
case 44:
|
||||
return "傍山险路(右侧)";
|
||||
case 47:
|
||||
return "上陡坡";
|
||||
case 48:
|
||||
return "下陡坡";
|
||||
case 49:
|
||||
return "过水路面";
|
||||
case 50:
|
||||
return "路面不平";
|
||||
case 52:
|
||||
return "慢行";
|
||||
case 53:
|
||||
return "注意危险";
|
||||
case 58:
|
||||
return "隧道";
|
||||
case 59:
|
||||
return "渡口";
|
||||
case 92:
|
||||
return "闯红灯";
|
||||
case 93:
|
||||
return "应急车道";
|
||||
case 94:
|
||||
return "非机动车道";
|
||||
case 100:
|
||||
return "不绑定电子眼高发地";
|
||||
case 101:
|
||||
return "车道违章";
|
||||
case 102:
|
||||
return "超速违章";
|
||||
}
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return mLon;
|
||||
}
|
||||
|
||||
public void setLon( double lon ) {
|
||||
this.mLon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return mLat;
|
||||
}
|
||||
|
||||
public void setLat( double lat ) {
|
||||
this.mLat = lat;
|
||||
}
|
||||
|
||||
public int getTrafficType() {
|
||||
return mTrafficType;
|
||||
}
|
||||
|
||||
public void setTrafficType( int trafficType ) {
|
||||
this.mTrafficType = trafficType;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
/**
|
||||
* 规划路线交互接口
|
||||
*/
|
||||
public interface OnCalculatePathItemClickInteraction {
|
||||
|
||||
/**
|
||||
* 点击:列表点击、线路点击
|
||||
*
|
||||
* @param tagId 线条ID
|
||||
*/
|
||||
void onItemClicked( String tagId );
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.map.search.drive;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/1
|
||||
* <p>
|
||||
* 驾驶路线
|
||||
*/
|
||||
public interface IMogoRoadSearch {
|
||||
|
||||
void searchRoadPath( Context context, MogoRoadSearchQuery query );
|
||||
|
||||
void setRoadPathSearchListener( IMogoRoadSearchListener listener );
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.map.search.drive;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/1
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface IMogoRoadSearchListener {
|
||||
|
||||
void onDrivePathSearched( List< MogoLatLng > points );
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.map.search.drive;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/1
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoRoadSearchQuery {
|
||||
|
||||
public MogoLatLng mStart;
|
||||
public MogoLatLng mTarget;
|
||||
public List<MogoLatLng> mWays;
|
||||
|
||||
public MogoRoadSearchQuery() {
|
||||
}
|
||||
|
||||
public MogoRoadSearchQuery setStart( MogoLatLng start ) {
|
||||
this.mStart = start;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoRoadSearchQuery setTarget( MogoLatLng target ) {
|
||||
this.mTarget = target;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoRoadSearchQuery setWays( List< MogoLatLng > ways ) {
|
||||
this.mWays = ways;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -344,4 +344,9 @@ public interface IMogoMapUIController {
|
||||
default void setMarkerInfoResName(String speedVal, String val) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置地图视线角度
|
||||
*/
|
||||
void setMapDAngle(float angle);
|
||||
}
|
||||
|
||||
@@ -43,17 +43,15 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
api rootProject.ext.dependencies.mapautomap
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
|
||||
} else {
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
api project(':libraries:map-autonavi')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @since 2020-11-05
|
||||
* <p>
|
||||
* 巡航代理
|
||||
*/
|
||||
public class MogoAimless implements IMogoAimless {
|
||||
|
||||
private IMogoAimless mDelegate;
|
||||
|
||||
private static volatile MogoAimless sInstance;
|
||||
|
||||
private MogoAimless( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getAimless( context );
|
||||
}
|
||||
|
||||
public static MogoAimless getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoAimless.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoAimless( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,13 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.impl.automap.navi.AutoNaviClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.AppUtils;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -50,24 +46,10 @@ class MogoMapDelegateFactory {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
public static IMogoNavi getNaviDelegate(Context context) {
|
||||
|
||||
if (DebugConfig.isUseCustomNavi()) {
|
||||
return getApiBuilder().getNavi(context);
|
||||
} else if (AppUtils.isAppInstalled(context, "com.autonavi.amapauto")) {
|
||||
return AutoNaviClient.getInstance(context);
|
||||
}
|
||||
return getApiBuilder().getNavi(context);
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate(Context context, MogoPoiSearchQuery query) {
|
||||
return getApiBuilder().getPoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
public static IMogoAimless getAimless(Context context) {
|
||||
return getApiBuilder().getAimless(context);
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ import android.location.Location;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -355,12 +355,18 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public long getTileId(double lon, double lat) {
|
||||
return mDelegate.getTileId(lon, lat);
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getTileId(lon, lat);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpeedLimmit(double lon, double lat, float angle) {
|
||||
return mDelegate.getSpeedLimmit(lon,lat,angle);
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getSpeedLimmit(lon,lat,angle);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -424,6 +430,11 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setMapDAngle(float angle) {
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
initDelegate();
|
||||
@@ -431,4 +442,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.clearRoadCacheById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoOperationListenerRegister;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航代理
|
||||
*/
|
||||
public class MogoNavi implements IMogoNavi {
|
||||
|
||||
private IMogoNavi mDelegate;
|
||||
|
||||
private static volatile MogoNavi sInstance;
|
||||
|
||||
private MogoNavi( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getNaviDelegate( context );
|
||||
}
|
||||
|
||||
public static MogoNavi getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoNavi.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoNavi( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.reCalculateRoute( config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startNavi( isRealNavi );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.isNaviing();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedStrategies();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedPathPos();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getItemClickInteraction();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
MogoOperationListenerRegister.getInstance().setLineClickInteraction( itemClickInteraction );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.clearCalculatePaths();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setCalculatePathDisplayBounds( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviConfig();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.setBroadcastMode( mode );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviPathCoordinates();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation2();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setUseExtraGPSData( use );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user