[Change]
增加控制地图「白天」「夜间」模式 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -455,6 +455,14 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改地图样式按钮(白天模式、夜间模式)
|
||||
*/
|
||||
tbChangeCurrentMapStyle.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
CallerHDMapManager.stepInVrMode(isChecked)
|
||||
}
|
||||
|
||||
//设置鹰眼本地参数配置监听
|
||||
setEagleEyeConfigListener()
|
||||
//域控制器中心事件点击监听
|
||||
|
||||
@@ -195,7 +195,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
// TODO 这里临时兼容进入VR模式
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.Type_VR);
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
|
||||
}, 1000);
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
});
|
||||
|
||||
@@ -1128,6 +1128,18 @@
|
||||
app:layout_constraintRight_toLeftOf="@id/btnDrawTrolley"
|
||||
app:layout_constraintTop_toBottomOf="@id/reset_changesight" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbChangeCurrentMapStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:textOff="切换地图为「白天模式」"
|
||||
android:textOn="切换地图为「夜间模式」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
|
||||
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDrawTrolley"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -9,15 +9,12 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
/**
|
||||
@@ -50,7 +47,6 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).initDelegate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,9 +60,9 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
try {
|
||||
mMogoMapView.getMap().getUIController().changeMapMode(EnumMapUI.Type_VR);
|
||||
mMogoMapView.getMap().getUIController().stepInVrMode(isDayMode);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -175,7 +171,6 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.mogo.eagle.core.function.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
* <p>
|
||||
* 地图控制交互层
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER)
|
||||
public class MapFrameController implements IMogoMapFrameController {
|
||||
|
||||
private IMogoMapFrameController mController;
|
||||
|
||||
@Override
|
||||
public void initDelegate(IMogoMapFrameController controller) {
|
||||
mController = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeTo2dMode() {
|
||||
if (mController != null) {
|
||||
mController.changeTo2dMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
if (mController != null) {
|
||||
mController.changeToVRMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MapIdentifySubscriber.Companion.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mController = null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -10,7 +10,6 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
@@ -21,6 +20,7 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
@@ -28,7 +28,6 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
@@ -234,10 +233,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
@Override
|
||||
public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
IMogoMapUIController mapUiController = MogoMapUIController.getInstance();
|
||||
if (mapUiController != null) {
|
||||
mapUiController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus();
|
||||
if (v2xStatus != null) {
|
||||
v2xStatus.setRoadEventPOIShow(TAG, true);
|
||||
|
||||
@@ -20,6 +20,7 @@ public interface IMogoMapFrameController extends IProvider, IDestroyable {
|
||||
|
||||
/**
|
||||
* 切换到自研vr
|
||||
* @param isNightMode true-夜间模式,false-白天模式
|
||||
*/
|
||||
void changeToVRMode();
|
||||
void stepInVrMode(boolean isNightMode);
|
||||
}
|
||||
|
||||
@@ -34,4 +34,12 @@ interface IMoGoMapFragmentProvider : IMoGoFunctionServerProvider {
|
||||
* 获取车道中心线信息
|
||||
*/
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine?
|
||||
|
||||
|
||||
/**
|
||||
* 进入VR 模式
|
||||
*
|
||||
* @param isDayMode true-白天模式,false-夜间模式
|
||||
*/
|
||||
fun stepInVrMode(isDayMode: Boolean)
|
||||
}
|
||||
@@ -50,4 +50,12 @@ object CallerHDMapManager : CallerBase() {
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine? {
|
||||
return mapProviderApi.getCenterLineInfo(lon, lat, angle)
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换到自研vr
|
||||
* @param isDayMode true-白天模式,false-夜间模式
|
||||
*/
|
||||
fun stepInVrMode(isDayMode: Boolean) {
|
||||
return mapProviderApi.stepInVrMode(isDayMode)
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ MOGO_LOCATION_VERSION=1.3.52
|
||||
MOGO_TELEMATIC_VERSION=1.3.52
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.0.9.11
|
||||
MAP_SDK_VERSION=2.1.0.3
|
||||
MAP_SDK_OPERATION_VERSION=1.0.12
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
@@ -1,80 +1,57 @@
|
||||
package com.mogo.map.uicontroller;
|
||||
package com.mogo.map.uicontroller
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* 地图样式
|
||||
*/
|
||||
public enum EnumMapUI {
|
||||
enum class EnumMapUI(val code: Int, private val next: Int) {
|
||||
/**
|
||||
* 2D 白天模式
|
||||
*/
|
||||
MAP_STYLE_DAY(0, 1),
|
||||
|
||||
/**
|
||||
* 正北朝上2D
|
||||
* 2D 夜晚模式
|
||||
*/
|
||||
NorthUP_2D(0, 1),
|
||||
/**
|
||||
* 车头朝上2D
|
||||
*/
|
||||
CarUp_2D(1, 2),
|
||||
MAP_STYLE_NIGHT(1, 2),
|
||||
|
||||
/**
|
||||
* 3D,只能头朝上
|
||||
* SATEL模式
|
||||
*/
|
||||
CarUp_3D(2, 0),
|
||||
Type_AUTO_LIGHT_Night(2, 3),
|
||||
|
||||
/**
|
||||
* 白天模式
|
||||
* 日间导航模式
|
||||
*/
|
||||
Type_Light(3, 5),
|
||||
MAP_STYLE_DAY_NAV(3, 4),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
* 夜间导航模式
|
||||
*/
|
||||
Type_Night(4, 4),
|
||||
MAP_STYLE_NIGHT_NAV(4, 5),
|
||||
|
||||
//------------------------2022-04-11暂时只有这两个使用-------------------------------
|
||||
/**
|
||||
* 夜间VR模式
|
||||
*/
|
||||
MAP_STYLE_NIGHT_VR(5, 6),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
* 白天VR模式
|
||||
*/
|
||||
Type_AUTO_LIGHT_Night(5, 3),
|
||||
MAP_STYLE_DAY_VR(6, 7);
|
||||
//-------------------------2022-04-11暂时只有这两个使用------------------------------
|
||||
|
||||
/**
|
||||
* 自研地图的VR模式
|
||||
*/
|
||||
Type_VR(0, 0),
|
||||
|
||||
/**
|
||||
* 视距远景
|
||||
*/
|
||||
MODE_LONG_SIGHT(6, 7),
|
||||
|
||||
/**
|
||||
* 视距中景
|
||||
*/
|
||||
MODE_MEDIUM_SIGHT(7, 8),
|
||||
|
||||
/**
|
||||
* 视距近景
|
||||
*/
|
||||
MODE_CLOSE_SIGHT(8, 6);
|
||||
|
||||
private int next;
|
||||
private int code;
|
||||
|
||||
EnumMapUI(int code, int next) {
|
||||
this.code = code;
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public EnumMapUI next() {
|
||||
for (EnumMapUI value : EnumMapUI.values()) {
|
||||
operator fun next(): EnumMapUI {
|
||||
for (value in values()) {
|
||||
if (value.code == next) {
|
||||
return value;
|
||||
return value
|
||||
}
|
||||
}
|
||||
return this;
|
||||
return this
|
||||
}
|
||||
|
||||
public int getCode(){
|
||||
return code;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,17 +25,6 @@ import mogo.telematics.pad.MessagePad;
|
||||
*/
|
||||
public interface IMogoMapUIController {
|
||||
|
||||
/**
|
||||
* 实时路况
|
||||
*/
|
||||
void setTrafficEnabled(boolean visible);
|
||||
|
||||
/**
|
||||
* 地图缩放
|
||||
*
|
||||
* @param zoomIn true - 放大 false - 缩小
|
||||
*/
|
||||
MapControlResult changeZoom(boolean zoomIn);
|
||||
|
||||
/**
|
||||
* 修改缩放级别
|
||||
@@ -49,6 +38,21 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void changeMapMode(EnumMapUI mode);
|
||||
|
||||
/**
|
||||
* 打开鹰眼模式
|
||||
*
|
||||
* @param zoomGestureEnable 是否支持手势缩放改变地图样式
|
||||
*/
|
||||
@Deprecated
|
||||
void openVrMode(boolean zoomGestureEnable);
|
||||
|
||||
/**
|
||||
* 进入VR 模式
|
||||
*
|
||||
* @param isDayMode true-白天模式,false-夜间模式
|
||||
*/
|
||||
void stepInVrMode(boolean isDayMode);
|
||||
|
||||
/**
|
||||
* 切换3D模式下远距,中距,近距视角
|
||||
*
|
||||
@@ -110,13 +114,6 @@ public interface IMogoMapUIController {
|
||||
void loseLockMode();
|
||||
|
||||
|
||||
/**
|
||||
* 预览全程
|
||||
*
|
||||
* @param bounds 显示范围
|
||||
*/
|
||||
void displayOverview(Rect bounds);
|
||||
|
||||
/**
|
||||
* 获取比例尺数据
|
||||
*
|
||||
@@ -301,32 +298,6 @@ public interface IMogoMapUIController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开鹰眼模式
|
||||
*
|
||||
* @param zoomGestureEnable 是否支持手势缩放改变地图样式
|
||||
*/
|
||||
default void openVrMode(boolean zoomGestureEnable) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将一个点匹配到车道的中心点
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @param isGpsLocation 是否是 gps 坐标
|
||||
* @param isRTK
|
||||
* @return
|
||||
*/
|
||||
default double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK) {
|
||||
return null;
|
||||
}
|
||||
|
||||
default void clearRoadCacheById(String id) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
@@ -355,6 +326,7 @@ public interface IMogoMapUIController {
|
||||
|
||||
/**
|
||||
* 获取行车方向
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
float getAngle(double startLon, double startLat, double endLon, double endLat);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.mogo.map.uicontroller;
|
||||
|
||||
/**
|
||||
* 切换视距
|
||||
*
|
||||
* @author zhongchao
|
||||
*/
|
||||
public enum VisualAngleMode implements IMogoMapVisualAngle {
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,6 @@ import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.map.utils.MogoMapUtils;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.mogo.map.utils.PointInterpolatorUtil;
|
||||
import com.mogo.map.utils.ResIdCache;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.abs.MapStatusListener;
|
||||
@@ -60,7 +59,6 @@ import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationListener;
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
|
||||
import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
|
||||
@@ -79,8 +77,6 @@ import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -149,7 +145,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
|
||||
mMapView.setOnMarkClickListener(this);
|
||||
mMarkerClickHandler = AMapMarkerClickHandler.getInstance();
|
||||
mMapView.setOnMapLoadedListener(this);
|
||||
@@ -306,46 +301,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (checkAMapView()) {
|
||||
// mMapView.getMapAutoViewHelper().setTraffic( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(boolean zoom) {
|
||||
if (checkAMapView()) {
|
||||
mDefaultZoomLevel = (getMap().getZoomLevel() + 0.5f);
|
||||
if (zoom) {
|
||||
if (mDefaultZoomLevel >= 20f) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
} else {
|
||||
if (mDefaultZoomLevel <= 7f) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
}
|
||||
|
||||
if (zoom) {
|
||||
mDefaultZoomLevel += 1f;
|
||||
if (mDefaultZoomLevel > 19f) {
|
||||
mDefaultZoomLevel = 19f;
|
||||
}
|
||||
} else {
|
||||
mDefaultZoomLevel -= 1f;
|
||||
if (mDefaultZoomLevel < 8f) {
|
||||
mDefaultZoomLevel = 8f;
|
||||
}
|
||||
}
|
||||
changeZoom(mDefaultZoomLevel);
|
||||
}
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "changeZoom : " + zoom);
|
||||
@@ -365,7 +323,14 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerLogger.INSTANCE.d(TAG, "设置的样式 :" + ui);
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
|
||||
if (ui == EnumMapUI.MAP_STYLE_DAY_VR) {
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY_VR);
|
||||
} else if (ui == EnumMapUI.MAP_STYLE_NIGHT_VR) {
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT_VR);
|
||||
} else {
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT_VR);
|
||||
CallerLogger.INSTANCE.e(TAG, "暂时不支持此模式 :" + ui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +388,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void showMyLocation(boolean visible) {
|
||||
CallerLogger.INSTANCE.d(TAG, "showMyLocation1 " + visible);
|
||||
// 如果是VR模式
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
// 不是VR模式情况强制刷新下
|
||||
@@ -437,6 +402,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isVrMold() {
|
||||
return mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
@@ -453,7 +422,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setMyLocationEnabled(true);
|
||||
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 );
|
||||
@@ -466,7 +434,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if (checkAMapView()) {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "锁车");
|
||||
@@ -476,17 +444,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void loseLockMode() {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "解锁锁车");
|
||||
mMapView.getMapAutoViewHelper().setLockMode(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
@@ -531,7 +495,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
if (checkAMapView()) {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
@@ -581,7 +545,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (!checkAMapView()) {
|
||||
return;
|
||||
}
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
CallerLogger.INSTANCE.w(TAG, "vr 模式下忽略该设置");
|
||||
return;
|
||||
}
|
||||
@@ -624,7 +588,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption(CarCursorOption option) {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
if (mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION) {
|
||||
@@ -805,6 +769,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
MogoMapListenerHandler.getInstance().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前视距类型
|
||||
*
|
||||
* @param mode 当前类型
|
||||
* @return 当前类型
|
||||
*/
|
||||
private VisualAngleMode getVisualAngleMode(int mode) {
|
||||
switch (mode) {
|
||||
case 0:
|
||||
@@ -849,35 +819,23 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle(int styleId) {
|
||||
|
||||
EnumMapUI last = mCurrentUI;
|
||||
CallerLogger.INSTANCE.d(TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
if (styleId == MapAutoApi.MAP_STYLE_DAY
|
||||
|| styleId == MapAutoApi.MAP_STYLE_DAY_NAV) {
|
||||
mCurrentUI = EnumMapUI.Type_Light;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT
|
||||
|| styleId == MapAutoApi.MAP_STYLE_NIGHT_NAV) {
|
||||
mCurrentUI = EnumMapUI.Type_Night;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_VR) {
|
||||
mCurrentUI = EnumMapUI.Type_VR;
|
||||
// 进入vr模式的时候自动切换到车头朝上
|
||||
change2CarUp();
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT_NAV) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_DAY_VR) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
}
|
||||
|
||||
if (last == mCurrentUI) {
|
||||
CallerLogger.INSTANCE.d(TAG, "currentUI is same as last = " + mCurrentUI);
|
||||
return;
|
||||
}
|
||||
|
||||
// vr 模式切换到普通模式下,保持之前的白天模式 wtf.
|
||||
if (last == EnumMapUI.Type_VR && mCurrentUI != EnumMapUI.Type_Light) {
|
||||
if (mIsLightStyle) {
|
||||
changeMapMode(EnumMapUI.Type_Light);
|
||||
return;
|
||||
}
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
if (mCurrentUI != null) {
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
@@ -891,13 +849,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换到车头朝上
|
||||
*/
|
||||
private void change2CarUp() {
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_CAR);
|
||||
}
|
||||
|
||||
// 是否使用RTK数据
|
||||
private boolean mRtkEnable = false;
|
||||
|
||||
@Override
|
||||
@@ -977,91 +929,25 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void openVrMode(boolean zoomGestureEnable) {
|
||||
try {
|
||||
mMapView.getMapAutoViewHelper().setZoomGesturesEnabled(zoomGestureEnable);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY_VR);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, RoadCacheWrapper> roadCacheMap = new ConcurrentHashMap<>();
|
||||
private final RoadCacheWrapper noCache = new RoadCacheWrapper(null);
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
roadCacheMap.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK) {
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 带缓存的道路匹配算法
|
||||
* <p>
|
||||
* 使用{@link MapDataApi#INSTANCE#getSinglePointMatchRoad()}这个方法获取道路数据会存在一定耗时,目前是4-10ms,因为请求频繁,为了
|
||||
* 减小这部分耗时,使用一个ConcurrentHashMap{@link #roadCacheMap}缓存道路数据,此缓存是以目标车id为key,道路数据为value,以此减少
|
||||
* 道路数据获取次数。
|
||||
* <p>
|
||||
* 当出现道路改变的情况,需要重新获取道路数据,采用递归的方式重获道路数据以及添加缓存,为了避免一直获取不到道路数据,一直递归,增加useCache参数跳出递归。
|
||||
* <p>
|
||||
* 道路改变的情况主要分为:
|
||||
* 1. 目标车距离道路中心线距离超过阈值 matchThreshold(取路宽的1/4为阈值);
|
||||
* 2. 目标车到道路中心线的映射点不在道路上(此判断在{@link PointInterpolatorUtil#mergeToRoad(double, double, List)}),也就是说已经驶出了这条道路
|
||||
*
|
||||
* @param id 目标车唯一标识
|
||||
* @param lon 目标车经度
|
||||
* @param lat 目标车纬度
|
||||
* @param angle 目标车角度
|
||||
* @param isGpsLocation true-使用gps定位数据
|
||||
* @param isRTK true-使用rtk数据
|
||||
* @param usdCache true-使用道路缓存 false-不使用道路缓存
|
||||
* @return double[]{匹配后经度,匹配后纬度,目标车距离车道中心线距离},若匹配后经纬度值为-1,则没有匹配成功
|
||||
*/
|
||||
private double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK, boolean usdCache) {
|
||||
double[] wgs = new double[]{lon, lat};
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
RoadCacheWrapper roadCache = roadCacheMap.get(id);
|
||||
double matchThreshold = -1;
|
||||
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()) {
|
||||
roadCache = new RoadCacheWrapper(singlePointRoadInfo.getCoords());
|
||||
roadCache.setLaneWidth(singlePointRoadInfo.getLaneWidth());
|
||||
}
|
||||
}
|
||||
|
||||
if (roadCache != null
|
||||
&& roadCache.getRoad() != null
|
||||
&& !roadCache.getRoad().isEmpty()) {
|
||||
// 未获取到道路中心线数据
|
||||
start = System.currentTimeMillis();
|
||||
matchThreshold = roadCache.getLaneWidth() / 4;
|
||||
|
||||
double[] matchedPoint = PointInterpolatorUtil.mergeToRoad(wgs[0], wgs[1], roadCache.getRoad());
|
||||
if (matchThreshold > 0 && matchedPoint[2] > 0 && matchedPoint[2] <= matchThreshold) {
|
||||
// 目标车在阈值范围内
|
||||
roadCacheMap.put(id, roadCache);
|
||||
// CallerLogger.INSTANCE.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchedPoint;
|
||||
// CallerLogger.INSTANCE.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
|
||||
} else if (matchedPoint[2] > matchThreshold && matchedPoint[2] < 1.5) {
|
||||
// 目标车在阈值范围外,也就是说距离道路中心线太远了,就不吸附了
|
||||
return null;
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
try {
|
||||
int mapStyle;
|
||||
if (isDayMode) {
|
||||
mapStyle = MapAutoApi.MAP_STYLE_DAY_VR;
|
||||
} else {
|
||||
// 目标车到道路中心线的映射点不在道路上,也就是已经使出了缓存的那条道路,需要重新获取一条道路,用useCache这个参数来避免重复递归
|
||||
roadCacheMap.put(id, noCache);
|
||||
// CallerLogger.INSTANCE.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
|
||||
if (usdCache) {
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK, false);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
mapStyle = MapAutoApi.MAP_STYLE_NIGHT_VR;
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(mapStyle);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
roadCacheMap.put(id, noCache);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1081,7 +967,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public float getAngle(double startLon, double startLat, double endLon, double endLat) {
|
||||
return MapAutoApi.INSTANCE.getAngle(startLon,startLat,endLon,endLat);
|
||||
return MapAutoApi.INSTANCE.getAngle(startLon, startLat, endLon, endLat);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,8 +63,9 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
.setPointToCenter(0.5f, 0.5f)
|
||||
.setStyleMode(MapParams.MAP_STYLE_VR);
|
||||
//.setPointToCenter(0.5f, 0.5f)
|
||||
// 默认地图样式
|
||||
.setStyleMode(MapParams.MAP_STYLE_NIGHT_VR);
|
||||
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
|
||||
@@ -58,23 +58,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setTrafficEnabled(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(boolean zoom) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.changeZoom(zoom);
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
initDelegate();
|
||||
@@ -159,15 +142,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.displayOverview(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
initDelegate();
|
||||
@@ -409,12 +383,11 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK) {
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.matchRoad(id, lon, lat, angle, isGpsLocation, isRTK);
|
||||
mDelegate.stepInVrMode(isDayMode);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -434,19 +407,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setMapDAngle(float angle) {
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.clearRoadCacheById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
initDelegate();
|
||||
|
||||
@@ -51,20 +51,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (mClient != null) {
|
||||
mClient.setTrafficEnabled(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(boolean zoom) {
|
||||
if (mClient != null) {
|
||||
return mClient.changeZoom(zoom);
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
@@ -131,12 +117,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
if (mClient != null) {
|
||||
mClient.displayOverview(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
@@ -339,13 +319,13 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK) {
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
if (mClient != null) {
|
||||
return mClient.matchRoad(id, lon, lat, angle, isGpsLocation, isRTK);
|
||||
mClient.stepInVrMode(isDayMode);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMarkerInfoResName(String speedVal) {
|
||||
if (mClient != null) {
|
||||
@@ -361,13 +341,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
if (mClient != null) {
|
||||
mClient.clearRoadCacheById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
if (mClient != null) {
|
||||
@@ -378,7 +351,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
@Override
|
||||
public float getAngle(double startLon, double startLat, double endLon, double endLat) {
|
||||
if (mClient != null) {
|
||||
return mClient.getAngle(startLon,startLat,endLon,endLat);
|
||||
return mClient.getAngle(startLon, startLat, endLon, endLat);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ import com.mogo.module.common.entity.MarkerShareMusic;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
@@ -65,10 +61,6 @@ public class MarkerDrawer {
|
||||
return drawMapMarkerImpl(markerShowEntity, false, zIndex, 0, listener);
|
||||
}
|
||||
|
||||
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, IMogoMarkerClickListener listener) {
|
||||
return drawMapMarkerImpl(markerShowEntity, matchRoadSide, zIndex, 0, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* add marker, { 如果是需要在3D模式下显示,则需要设置 {@link MogoMarkerOptions icon3DRes 资源id}}
|
||||
*
|
||||
@@ -120,63 +112,6 @@ public class MarkerDrawer {
|
||||
return marker;
|
||||
}
|
||||
|
||||
/**
|
||||
* S = (A ∩ B) ∪ B
|
||||
* (A ∩ B)作为旧列表需要保留的部分
|
||||
*
|
||||
* @param newList
|
||||
* @return
|
||||
*/
|
||||
public Map<String, IMogoMarker> purgeMarkerData(List newList, String markerType) {
|
||||
Map<String, IMogoMarker> existMap = new HashMap<>();
|
||||
List<IMogoMarker> allCarsList = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).getMarkers(markerType);
|
||||
if (allCarsList == null || allCarsList.isEmpty()) {
|
||||
return existMap;
|
||||
}
|
||||
if (newList == null || newList.isEmpty()) {
|
||||
return existMap;
|
||||
}
|
||||
|
||||
Map<String, IMogoMarker> allMap = new HashMap<>();
|
||||
for (IMogoMarker marker : allCarsList) {
|
||||
String sn = getPrimaryKeyFromMarker(marker);
|
||||
allMap.put(sn, marker);
|
||||
}
|
||||
for (Object entity : newList) {
|
||||
String sn = getPrimaryKeyFromEntity(entity);
|
||||
if (allMap.containsKey(sn)) {
|
||||
if (!isNewVehicleType(entity, allMap.get(sn))) {
|
||||
existMap.put(sn, allMap.get(sn));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String sn : allMap.keySet()) {
|
||||
if (!existMap.containsKey(sn)) {
|
||||
IMogoMarker dirtyMarker = allMap.get(sn);
|
||||
allCarsList.remove(dirtyMarker);
|
||||
if (dirtyMarker != null) {
|
||||
dirtyMarker.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
allMap.clear();
|
||||
return existMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param maxAmount 展示的最大数量
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public int getAppropriateSize(int maxAmount, List list) {
|
||||
if (list == null) {
|
||||
return 0;
|
||||
}
|
||||
return Math.min(maxAmount, list.size());
|
||||
}
|
||||
|
||||
|
||||
private boolean isNewVehicleType(Object object, IMogoMarker marker) {
|
||||
if (object instanceof MarkerOnlineCar
|
||||
&& marker != null
|
||||
@@ -229,16 +164,6 @@ public class MarkerDrawer {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getCarSnFromMarker(IMogoMarker marker) {
|
||||
if (marker == null || marker.getObject() == null || marker.isDestroyed()) {
|
||||
return null;
|
||||
}
|
||||
if (!(marker.getObject() instanceof MarkerShowEntity)) {
|
||||
return null;
|
||||
}
|
||||
return getCarSnFromEntity(((MarkerShowEntity) marker.getObject()).getBindObj());
|
||||
}
|
||||
|
||||
/**
|
||||
* 距离半径计算方式
|
||||
*
|
||||
|
||||
@@ -152,9 +152,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
private boolean mLastStatusIsVr = false;
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
public void onMapModeChanged(EnumMapUI mCurrentUI) {
|
||||
clearAllData();
|
||||
if (ui == EnumMapUI.Type_VR) {
|
||||
if (mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR) {
|
||||
if (!mLastStatusIsVr) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
|
||||
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.receiver.AccStatusReceiver;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
|
||||
@@ -27,7 +25,6 @@ public class IntentHandlerFactory {
|
||||
mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( AccStatusReceiver.ACTION_NWD_ACC, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
mHandlers.put( ConnectivityManager.CONNECTIVITY_ACTION, new NetworkChangedIntentHandler() );
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
|
||||
@@ -13,10 +13,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -252,20 +249,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
intent3.putExtra("EXTRA_REQUEST_AUTO_STATE", 0);
|
||||
context.sendBroadcast(intent3);
|
||||
break;
|
||||
case 32:// 控制实时路况
|
||||
MogoMapUIController.getInstance().setTrafficEnabled(true);
|
||||
break;
|
||||
case 33:// 测试小智语音
|
||||
AIAssist.getInstance(context).speakTTSVoice("庞帆说这个是一个 hard coding.");
|
||||
break;
|
||||
case 34:// 修改地图模式VR OR 2D
|
||||
int type = intent.getIntExtra("type", 0);
|
||||
if (type != 0) {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).changeToVRMode();
|
||||
} else {
|
||||
CallerBase.getApiInstance(IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER).changeTo2dMode();
|
||||
}
|
||||
break;
|
||||
case 36:// 测试打点功能
|
||||
MogoLatLng center = MogoMapUIController.getInstance()
|
||||
.getWindowCenterLocation();
|
||||
@@ -393,10 +379,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 45:// 测试开启鹰眼模式
|
||||
MogoMapUIController.getInstance()
|
||||
.openVrMode(false);
|
||||
break;
|
||||
case 46:// 模拟鹰眼模式下绘制车辆周边的数据
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
break;
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/8/17
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class NetworkChangedIntentHandler implements IntentHandler {
|
||||
|
||||
private static final String TAG = "NetworkChangedIntentHandler";
|
||||
|
||||
@Override
|
||||
public void handle( Context context, Intent intent ) {
|
||||
if ( NetworkUtils.isConnected( context ) ) {
|
||||
try {
|
||||
MogoMapUIController.getInstance()
|
||||
.setTrafficEnabled( true );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user