Merge branch 'dev/dev_eagle_architecture_upgrade' into dev/dev_eagle_check

# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/mogo/launcher/MogoApplication.java
#	gradle.properties
#	modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/status/EnvStatusManager.java
#	services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java
#	services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
#	services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java
This commit is contained in:
liujing
2021-09-15 18:09:27 +08:00
1270 changed files with 23741 additions and 379701 deletions

View File

@@ -548,6 +548,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
return;
}
if ( checkAMapView() ) {
MyLocationStyle style = getMyLocationStyle();
if ( style == null ) {
@@ -556,6 +557,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
style.showMyLocation( visible );
if ( mCurrentUIMode == EnumMapUI.CarUp_2D
|| mCurrentUIMode == EnumMapUI.CarUp_3D ) {
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
} else {
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );

View File

@@ -311,9 +311,9 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void setAdasRecognizedResult(int drawlevel) {
public void setAdasRecognizedResult(int drawLevel) {
if ( mClient != null ) {
mClient.setAdasRecognizedResult(drawlevel);
mClient.setAdasRecognizedResult(drawLevel);
}
}

View File

View File

@@ -53,10 +53,6 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
annotationProcessor rootProject.ext.dependencies.aroutercompiler
// api rootProject.ext.dependencies.amapnavi3dmap
// api rootProject.ext.dependencies.amapsearch
// api rootProject.ext.dependencies.amaplocation
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogomapapi
@@ -67,8 +63,6 @@ dependencies {
implementation project(':foudations:mogo-commons')
}
implementation rootProject.ext.dependencies.mogocustommap
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.47'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,5 +1,9 @@
package com.mogo.map.impl.custom;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Point;
@@ -16,6 +20,7 @@ import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.TextView;
import com.mogo.commons.FunctionBuildConfig;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.IMogoMap;
@@ -71,10 +76,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT;
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT;
public class AMapViewWrapper implements IMogoMapView,
IMogoMapUIController,
LocationListener,
@@ -114,7 +115,6 @@ public class AMapViewWrapper implements IMogoMapView,
public AMapViewWrapper(MapAutoView mMapView) {
startTime = System.currentTimeMillis();
Logger.i(TAG, "autoop--AMapViewWrapper: init");
// Logger.i("lianglihui", "autoop--AMapViewWrapper: init");
this.mMapView = mMapView;
if (DebugConfig.isDebug()) {
GpsTester.getInstance().init(mMapView);
@@ -136,64 +136,64 @@ public class AMapViewWrapper implements IMogoMapView,
if (options != null) {
options.setZoomGesturesEnabled(true);
// 设置是否开启自动黑夜模式切换默认为false不自动切换
// options.setAutoSwitchStyle(false);
// options.setAutoSwitchStyle(false);
// 设置6秒后是否自动锁车
// options.setAutoLockCar( false );
// options.setAutoLockCar( false );
// 设置路线上的摄像头气泡是否显示
// options.setCameraBubbleShow( true );
// options.setCameraBubbleShow( true );
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
// 设置自车的图片对象
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(DEFAULT_OPTION.getCarCursorRes()));
// 设置指南针图标否在导航界面显示默认显示。true显示false隐藏。
// options.hiddenDirection();
// options.hiddenDirection();
// 黑夜模式
// options.setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
// options.setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
// options.setTrafficBarEnabled( false );
// options.setTrafficBarEnabled( false );
// 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
// options.setTrafficLayerEnabled( false );
// options.setTrafficLayerEnabled( false );
// 设置导航界面是否显示路线全览按钮。
// options.setRouteListButtonShow( false );
// options.setRouteListButtonShow( false );
// 设置导航状态下屏幕是否一直开启。
// options.setScreenAlwaysBright( true );
// options.setScreenAlwaysBright( true );
// 设置交通播报是否打开(只适用于驾车导航,需要联网)。
// options.setTrafficInfoUpdateEnabled( true );
// options.setTrafficInfoUpdateEnabled( true );
// 设置摄像头播报是否打开(只适用于驾车导航)。
// options.setCameraInfoUpdateEnabled( true );
// options.setCameraInfoUpdateEnabled( true );
// 设置菜单按钮是否在导航界面显示。
// options.setSettingMenuEnabled( false );
// options.setSettingMenuEnabled( false );
// 设置是否绘制显示交通路况的线路(彩虹线),拥堵-红色,畅通-绿色,缓慢-黄色,未知-蓝色。默认不绘制彩虹线。
// options.setTrafficLine( true );
// options.setTrafficLine( true );
// 设置是否绘制牵引线(当前位置到目的地的指引线)。默认不绘制牵引线。
// options.setLeaderLineEnabled( -1 );
// options.setLeaderLineEnabled( -1 );
// 设置导航界面UI是否显示。
// options.setLayoutVisible( false );
// options.setLayoutVisible( false );
// 设置是否自动画路
// options.setAutoDrawRoute( false );
// options.setAutoDrawRoute( false );
// 设置是否显示路口放大图(实景图)
// options.setRealCrossDisplayShow( false );
// options.setRealCrossDisplayShow( false );
// 设置是否显示路口放大图(路口模型图)
// options.setModeCrossDisplayShow( false );
// options.setModeCrossDisplayShow( false );
// 设置是否显示道路信息view
// options.setLaneInfoShow( false );
// options.setLaneInfoShow( false );
// 设置是否自动改变缩放等级
// options.setAutoChangeZoom( false );
// options.setAutoChangeZoom( false );
// 设置是否自动全览模式,即在算路成功后自动进入全览模式
// options.setAutoDisplayOverview( false );
// options.setAutoDisplayOverview( false );
// 设置路线转向箭头隐藏和显示
// options.setNaviArrowVisible( false );
// options.setNaviArrowVisible( false );
// 通过路线是否自动置灰,仅支持驾车导航
// options.setAfterRouteAutoGray( true );
// options.setZoom(((int) mDefaultZoomLevel));
// options.setPointToCenter( 0.5D, 0.5D );
// options.setAfterRouteAutoGray( true );
// options.setZoom(((int) mDefaultZoomLevel));
// options.setPointToCenter( 0.5D, 0.5D );
// 2D模式
// options.setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_2D);
// mMapView.setViewOptions( options );
// options.setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_2D);
// mMapView.setViewOptions( options );
}
// mMapView.setRouteOverlayVisible( false );
// mMapView.setCarOverlayVisible( false );
// setUIMode(EnumMapUI.CarUp_2D);
// mMapView.setRouteOverlayVisible( false );
// mMapView.setCarOverlayVisible( false );
// setUIMode(EnumMapUI.CarUp_2D);
}
private void initListeners() {
@@ -204,7 +204,7 @@ public class AMapViewWrapper implements IMogoMapView,
mMapView.setOnMapTouchListener(this);
mMapView.setOnMapClickListener(this);
mMapView.getLocationClient().registerListener(this);
// mMapView.getLocationClient().registerGpsListener( 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);
@@ -213,17 +213,17 @@ public class AMapViewWrapper implements IMogoMapView,
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 );
// 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() {
@@ -295,7 +295,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void setTrafficEnabled(boolean visible) {
if (checkAMapView()) {
// mMapView.getMapAutoViewHelper().setTraffic( visible );
// mMapView.getMapAutoViewHelper().setTraffic( visible );
}
}
@@ -347,33 +347,32 @@ public class AMapViewWrapper implements IMogoMapView,
if (ui == null) {
return;
}
// TODO 这里临时修改关闭2D
Logger.d(TAG, "设置的样式 = %s", ui);
if (checkAMapView()) {
switch (ui) {
case CarUp_2D:
case CarUp_3D:
case NorthUP_2D:
setUIMode(ui);
break;
// case CarUp_2D:
// case CarUp_3D:
// case NorthUP_2D:
// setUIMode(ui);
// break;
case Type_VR:
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
}
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
return;
case Type_Light:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
mIsLightStyle = true;
break;
case Type_Night:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
mIsLightStyle = false;
break;
case Type_AUTO_LIGHT_Night:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
break;
// case Type_Light:
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
// mIsLightStyle = true;
// break;
// case Type_Night:
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
// mIsLightStyle = false;
// break;
// case Type_AUTO_LIGHT_Night:
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
// break;
}
}
@@ -459,9 +458,9 @@ public class AMapViewWrapper implements IMogoMapView,
if (visible && NaviClient.getInstance(getContext()).isNaviing()) {
return;
}
// if (DebugConfig.isDebug()) {
// Logger.d(TAG, Log.getStackTraceString(new Throwable()));
// }
// if (DebugConfig.isDebug()) {
// Logger.d(TAG, Log.getStackTraceString(new Throwable()));
// }
if (checkAMapView()) {
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
if (visible) {
@@ -494,10 +493,10 @@ public class AMapViewWrapper implements IMogoMapView,
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
style.setLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER);
style.interval(1000);
// style.anchor( 0.5F, 0.5F );
// style.strokeColor( Color.TRANSPARENT );
// style.strokeWidth( 0 );
// style.radiusFillColor( Color.TRANSPARENT );
// style.anchor( 0.5F, 0.5F );
// style.strokeColor( Color.TRANSPARENT );
// style.strokeWidth( 0 );
// style.radiusFillColor( Color.TRANSPARENT );
mMapView.getMapAutoViewHelper().setMyLocationStyle(style);
}
}
@@ -505,14 +504,14 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void recoverLockMode() {
if (checkAMapView()) {
// if ( DebugConfig.isDebug() ) {
// Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
// }
// if ( DebugConfig.isDebug() ) {
// Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
// }
if (mCurrentUI == EnumMapUI.Type_VR) {
return;
}
Logger.d(TAG, "锁车");
// mMapView.getMapAutoViewHelper().setZoom(mLockZoom);
// mMapView.getMapAutoViewHelper().setZoom(mLockZoom);
mMapView.getMapAutoViewHelper().setLockMode(true);
mIsCarLocked = true;
}
@@ -621,20 +620,20 @@ public class AMapViewWrapper implements IMogoMapView,
return;
}
try {
// final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() );
// Point point = mMapView.getMap().getProjection().toScreenLocation( latLng );
// point.y -= WindowUtils.dip2px( getContext(), high );
// LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point );
// //使用TranslateAnimation,填写一个需要移动的目标点
// Animation animation = new TranslateAnimation( target );
// animation.setInterpolator( interpolator );
// //整个移动所需要的时间
// animation.setDuration( duration );
// //设置动画
// if ( marker instanceof AMapMarkerWrapper ) {
// ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation );
// ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation();
// }
// final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() );
// Point point = mMapView.getMap().getProjection().toScreenLocation( latLng );
// point.y -= WindowUtils.dip2px( getContext(), high );
// LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point );
// //使用TranslateAnimation,填写一个需要移动的目标点
// Animation animation = new TranslateAnimation( target );
// animation.setInterpolator( interpolator );
// //整个移动所需要的时间
// animation.setDuration( duration );
// //设置动画
// if ( marker instanceof AMapMarkerWrapper ) {
// ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation );
// ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation();
// }
} catch (Exception e) {
Logger.e(TAG, e, "error.");
}
@@ -772,13 +771,15 @@ public class AMapViewWrapper implements IMogoMapView,
sysLocation.setBearing(location.getHeading());
sysLocation.setSpeed(location.getSpeed());
// 暂存本地提供给下一次的Http-DNS使用防止首次请求位置获取不到
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, location.getCityCode());
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_LATITUDE, String.valueOf(location.getLat()));
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_LONGITUDE, String.valueOf(location.getLon()));
// 将有效经纬度暂存本地提供给下一次的Http-DNS使用防止首次请求位置获取不到
if (location.getLat() > 0) {
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, location.getCityCode());
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_LATITUDE, String.valueOf(location.getLat()));
SharedPrefsMgr.getInstance(mMapView.getContext())
.putString(SharedPrefsConstants.LOCATION_LONGITUDE, String.valueOf(location.getLon()));
}
NaviClient.getInstance(getContext()).syncCarLocation(sysLocation);
@@ -829,7 +830,7 @@ public class AMapViewWrapper implements IMogoMapView,
// }, 6_000L);
}
showSelfSpeed(location.getSpeed());
//showSelfSpeed(location.getSpeed());
}
private int mDrawlevel;
@@ -899,6 +900,8 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onMapLoaded() {
Logger.i(TAG, "autoop--onMapLoaded: ");
// TODO 这里只有小巴车才会替换自车模型
//MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(R.raw.selfbus, true); //修改自车模型,未来需区分车的类型
mMapView.getMapAutoViewHelper().setRenderFrequency(true, 50);
MogoMapListenerHandler.getInstance().onMapLoaded();
mMapLoaded = true;
@@ -933,7 +936,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onMapStatusChanged(int type, int value) {
// Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
// Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
}
@Override
@@ -958,12 +961,12 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onCameraChange(int type, int value) {
// Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
// Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
}
@Override
public void onCameraChangeFinish(@Nullable CameraPosition cameraPosition) {
// Logger.i( TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
// Logger.i( TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
if (cameraPosition != null) {
Trace.beginSection("timer.onCameraChangeFinish");
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
@@ -990,7 +993,7 @@ public class AMapViewWrapper implements IMogoMapView,
}
//目前切换完vr之后会立即回调其他样式这里做一个判断
// private boolean mVrModeAutoChangedFlag = false;
// private boolean mVrModeAutoChangedFlag = false;
@Override
public void onChangeMapStyle(int i) {
@@ -1009,11 +1012,11 @@ public class AMapViewWrapper implements IMogoMapView,
// 进入vr模式的时候自动切换到车头朝上
change2CarUp();
}
// else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
// mCurrentUI = EnumMapUI.CarUp_2D;
// } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
// mCurrentUI = EnumMapUI.CarUp_3D;
// }
// else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
// mCurrentUI = EnumMapUI.CarUp_2D;
// } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
// mCurrentUI = EnumMapUI.CarUp_3D;
// }
if (last == mCurrentUI) {
Logger.d(TAG, "currentUI is same as last = %s", mCurrentUI);
@@ -1028,10 +1031,10 @@ public class AMapViewWrapper implements IMogoMapView,
changeMapMode(EnumMapUI.Type_Light);
return;
}
// if ( mVrModeAutoChangedFlag ) {
// mVrModeAutoChangedFlag = false;
// return;
// }
// if ( mVrModeAutoChangedFlag ) {
// mVrModeAutoChangedFlag = false;
// return;
// }
}
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
if (mCurrentUI != null) {
@@ -1063,7 +1066,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (isVrMode) {
if (mCurrentUI != EnumMapUI.Type_VR) {
Logger.d(TAG, "自动切换为vr模式");
// mVrModeAutoChangedFlag = true;
// mVrModeAutoChangedFlag = true;
changeMapMode(EnumMapUI.Type_VR);
}
} else {
@@ -1111,22 +1114,28 @@ public class AMapViewWrapper implements IMogoMapView,
long satelliteTime = data.optLong("satelliteTime");
long receiverDataTime = data.optLong("receiverDataTime");
long adasSatelliteTime = data.optLong("adasSatelliteTime");
if (lon == -1) {
return;
int gpsProvider = data.optInt("gpsProvider", 1);
// 使用与渠道配置一样的gps提供者提供的数据
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
if (lon == -1) {
return;
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate(yawRate);
bean.setHeading(heading);
bean.setAcceleration(acceleration);
bean.setAlt(alt);
bean.setSystemTime(systemTime);
bean.setSatelliteTime(satelliteTime);
bean.setReceiverDataTime(receiverDataTime);
bean.setAdasSatelliteTime(adasSatelliteTime);
bean.setLon(lon);
bean.setGnss_speed(((float) speed));
bean.setLat(lat);
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
}
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
bean.setYaw_rate(yawRate);
bean.setHeading(heading);
bean.setAcceleration(acceleration);
bean.setAlt(alt);
bean.setSystemTime(systemTime);
bean.setSatelliteTime(satelliteTime);
bean.setReceiverDataTime(receiverDataTime);
bean.setAdasSatelliteTime(adasSatelliteTime);
bean.setLon(lon);
bean.setGnss_speed(((float) speed));
bean.setLat(lat);
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
}
@Override
@@ -1183,33 +1192,33 @@ public class AMapViewWrapper implements IMogoMapView,
if (roadCache == null || roadCache == noCache) {
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(((float) wgs[0]), ((float) wgs[1]), ((float) angle), isGpsLocation, isRTK);
if (singlePointRoadInfo != null && singlePointRoadInfo.getCoords() != null && !singlePointRoadInfo.getCoords().isEmpty()) {
// Log.i("timer-matchRoad-4", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + singlePointRoadInfo.getRoadId());
// 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();
// }
// 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();
// }
}
}
// Log.i("timer-matchRoad-1", "cost " + (System.currentTimeMillis() - start) + "ms");
// Log.i("timer-matchRoad-1", "cost " + (System.currentTimeMillis() - start) + "ms");
if (roadCache != null
&& roadCache.getRoad() != null
&& !roadCache.getRoad().isEmpty()) {
@@ -1221,16 +1230,16 @@ public class AMapViewWrapper implements IMogoMapView,
if (matchThreshold > 0 && matchedPoint[2] > 0 && matchedPoint[2] <= matchThreshold) {
// 目标车在阈值范围内
roadCacheMap.put(id, roadCache);
// Logger.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
// Logger.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
return matchedPoint;
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
} else if (matchedPoint[2] > matchThreshold && matchedPoint[2] < 1.5) {
// 目标车在阈值范围外,也就是说距离道路中心线太远了,就不吸附了
return null;
} else {
// 目标车到道路中心线的映射点不在道路上也就是已经使出了缓存的那条道路需要重新获取一条道路用useCache这个参数来避免重复递归
roadCacheMap.put(id, noCache);
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
if (usdCache) {
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK, false);
} else {

View File

@@ -94,15 +94,19 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
@Override
public IMogoMapView getMapView( Context context ) {
Log.d(TAG,"setDebugMode==true");
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
.setDebugMode( DebugConfig.isDebug() )
.setDataFileSource(1) //todo 1-使用本地地图数据0-使用在线地图数据
MapParams mapParams = MapParams.Companion.init();
mapParams.setDebugMode( false )
// .setDataFileSource(1) //todo 1-使用本地地图数据0-使用在线地图数据
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
.setZoom( 20 )
// .setPointToCenter( 0.734375f, 0.5f )
// .setZoom( 20 )
// .setPointToCenter( 0.734375f, 0.5f )
.setPointToCenter( 0.5f, 0.5f ) //todo 2D模式下需要注意ADAS部分遮挡
.setStyleMode( MapParams.MAP_STYLE_NIGHT ), NavParams.Companion.init() );
.setStyleMode( MapParams.MAP_STYLE_VR );
NavAutoApi.INSTANCE.init( context, mapParams, NavParams.Companion.init());
MapAutoView mapAutoView = new MapAutoView(context);
IMogoMapView mapView = new AMapViewWrapper(mapAutoView);
return mapView;

View File

@@ -533,8 +533,13 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
if ( TextUtils.equals( mLastAnchorColor, anchorColor ) ) {
return;
}
mMogoMarkerOptions.anchorColor( anchorColor );
mMarker.setAnchorColor( anchorColor );
if (mMogoMarkerOptions != null) {
mMogoMarkerOptions.anchorColor( anchorColor );
}
if (mMarker != null) {
mMarker.setAnchorColor( anchorColor );
}
mLastAnchorColor = anchorColor;
}
@@ -543,7 +548,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
try {
mMarker.setInfoWindowView( view );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
e.printStackTrace();
}
}
@@ -552,7 +557,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
try {
mMarker.setMarkerInfoName( viewResName );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
e.printStackTrace();
}
}
@@ -567,11 +572,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
@Override
public void addDynamicAnchorPosition( MogoLatLng latLng, float angle, long duration ) {
try {
mMarker.addDynamicAnchorPostion( new LonLatPoint( latLng.lon, latLng.lat, angle ), System.currentTimeMillis(), ( int ) duration);
} catch ( Exception e ) {
e.printStackTrace();
}
mMarker.addDynamicAnchorPostion( new LonLatPoint( latLng.lon, latLng.lat, angle ), System.currentTimeMillis(), ( int ) duration);
}
@Override
@@ -580,6 +581,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
try {
return mMarker.getMarkeOptions().getMarkerIconName();
} catch ( Exception e ) {
e.printStackTrace();
}
}
return "";
@@ -591,6 +593,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
try {
return mMarker.getMarkeOptions().getMarkerInfoName();
} catch ( Exception e ) {
e.printStackTrace();
}
}
return "";

View File

@@ -737,11 +737,6 @@ public class ObjectUtils {
}
target.setLineWidth( options.getWidth() );
target.setColor( options.getColor() );
// target.setGps(options.gps()); //todo 地图侧 验证画线问题 需要设置GPS提前至加点之前
// target.zIndex( options.getWidth() );
// target.visible( options.isVisible() );
//// target.geodesic( options.isGeodesic() );
// target.setDottedLine( options.isDottedLine() );
target.useGradient( options.isGradient() );
if ( options.getColorValues() != null ) {
target.colorValues( options.getColorValues() );

Binary file not shown.

View File

@@ -0,0 +1,3 @@
##### 说明
不做具体实现,这里自定义具备那些功能
注意:所有的坐标系都是用 WGS84GPS坐标系如果涉及到了高德坐标系使用 CoordinatesTransformer 进行转换

View File

@@ -34,10 +34,8 @@ dependencies {
api rootProject.ext.dependencies.arouter
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
} else {
implementation project(':foudations:mogo-utils')
implementation project(':foudations:mogo-commons')
}
}

View File

@@ -0,0 +1,2 @@
#### 说明
这里所提供的功能都是通过 ARouter 使用依赖查找的方式发现服务,主动去发现服务并使用

View File

@@ -25,7 +25,6 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.callchatprovider
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils

View File

@@ -47,7 +47,6 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.aiassist
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation rootProject.ext.dependencies.okhttpinterceptor
implementation 'com.zhidaoauto.controller:api:1.0.8'
implementation 'com.zhidao.cosupload:cosuploadsdk:1.1.6', {
@@ -71,7 +70,7 @@ dependencies {
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogomap
implementation rootProject.ext.dependencies.mogoserviceapi
} else {