[2.13.0-arch-opt] merge
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.map">
|
||||
package="com.mogo.eagle.core.function.view">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.function
|
||||
|
||||
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.base.IMoGoFunctionServerProvider
|
||||
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
||||
import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_BIZ)
|
||||
class MapBizProvider :IMoGoFunctionServerProvider{
|
||||
|
||||
override val functionName: String
|
||||
get() = "MapBizProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
MapIdentifySubscriber.instance
|
||||
MogoRouteOverlayManager.getInstance().init()
|
||||
MapPointCloudSubscriber.instance
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import android.annotation.SuppressLint;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TrackObj {
|
||||
lon = data.getLongitude();
|
||||
s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude());
|
||||
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后
|
||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
|
||||
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
|
||||
if (centerLine != null && centerLine.getAngle() != 0) {
|
||||
roadAngle = centerLine.getAngle();
|
||||
}
|
||||
@@ -55,8 +55,8 @@ public class TrackObj {
|
||||
}
|
||||
|
||||
private void correct() {
|
||||
calAverageSpeedAndType();
|
||||
calLoc();
|
||||
// calAverageSpeedAndType();
|
||||
// calLoc();
|
||||
// calHeading();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class TrackObj {
|
||||
//更正数据,速度小于LIMIT_SPEED使用上一帧数据
|
||||
if (relativeStatic()) {
|
||||
if (roadAngle != 0.0) {
|
||||
CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
|
||||
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
|
||||
if (centerLine != null && centerLine.getAngle() != 0) {
|
||||
cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build();
|
||||
} else {
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Context;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.function.impl.marker.AdasRecognizedType;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -9,7 +9,7 @@ import android.widget.ImageView;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import android.widget.LinearLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.map.PoiWrapper;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.eagle.core.data.config.CloudPoiManager;
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.map.MogoMapView
|
||||
|
||||
class MapBizView(context: Context?) : MogoMapView(context), IMoGoSkinModeChangeListener,
|
||||
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener {
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
map.uiController.showMyLocation(true)
|
||||
|
||||
CallerSkinModeListenerManager.addListener(MapFragment.functionName, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(MapFragment.functionName, this)
|
||||
CallerChassisLamplightListenerManager.addListener(MapFragment.functionName, this)
|
||||
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// 先取消注册数据,再onDestroy
|
||||
CallerSkinModeListenerManager.removeListener(MapFragment.functionName)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(MapFragment.functionName)
|
||||
CallerChassisLamplightListenerManager.removeListener(MapFragment.functionName)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,336 +0,0 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import chassis.Chassis
|
||||
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.map.CenterLine
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
||||
import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.map.IMogoMap
|
||||
import com.mogo.map.MogoMapView
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @since 2021-11-09
|
||||
* 高精度地图层UI
|
||||
* 地图图层,地图操作都在这个图层完成 //todo 以view方式进行提供
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
||||
class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
MapView,
|
||||
IMoGoMapFragmentProvider,
|
||||
IMoGoSkinModeChangeListener,
|
||||
IMoGoChassisLocationWGS84Listener,
|
||||
IMoGoChassisLamplightListener {
|
||||
|
||||
private var mMogoMapView: MogoMapView? = null
|
||||
private var mMogoMap: IMogoMap? = null
|
||||
|
||||
companion object {
|
||||
const val functionName = "MapFragment"
|
||||
|
||||
/**
|
||||
* sight mode
|
||||
*
|
||||
* @param mode
|
||||
*/
|
||||
const val SIGHT_MODE_NORMAL = 0
|
||||
const val SIGHT_MODE_TOP = 1
|
||||
const val SIGHT_MODE_BACK = 2
|
||||
const val SIGHT_MODE_CROSS = 3
|
||||
const val SIGHT_MODE_FAR = 4
|
||||
}
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_map_fragment_map
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return Companion.functionName
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
}
|
||||
|
||||
override fun stepInVrMode(isDayMode: Boolean) {
|
||||
try {
|
||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
||||
mMogoMapView!!.map.uiController.stepInVrMode(isDayMode)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
// do not implement
|
||||
}
|
||||
|
||||
override fun initViews(savedInstanceState: Bundle?) {
|
||||
super.initViews(savedInstanceState)
|
||||
mMogoMapView = findViewById(R.id.module_map_id_map)
|
||||
mMogoMapView!!.onCreate(savedInstanceState)
|
||||
mMogoMap = mMogoMapView!!.map
|
||||
if (mMogoMap != null) {
|
||||
mMogoMap!!.uiController.showMyLocation(true)
|
||||
}
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(Companion.functionName, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this)
|
||||
CallerChassisLamplightListenerManager.addListener(Companion.functionName, this)
|
||||
}
|
||||
|
||||
override fun createPresenter(): MapPresenter {
|
||||
return MapPresenter(this)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initMapView()
|
||||
initMapBiz()
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onSaveInstanceState(outState)
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onPause()
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onResume()
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLowMemory() {
|
||||
super.onLowMemory()
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onLowMemory()
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMapView() {
|
||||
mMogoMap = mMogoMapView!!.map
|
||||
if (mMogoMap == null) {
|
||||
return
|
||||
}
|
||||
val uiSettings = mMogoMap!!.uiSettings
|
||||
if (uiSettings != null) {
|
||||
//设置所有手势是否可用
|
||||
uiSettings.setAllGesturesEnabled(true)
|
||||
//设置指南针是否可见。
|
||||
uiSettings.setCompassEnabled(false)
|
||||
//设置室内地图楼层切换控件是否可见。
|
||||
uiSettings.setIndoorSwitchEnabled(true)
|
||||
//设置定位按钮是否可见。
|
||||
uiSettings.setMyLocationButtonEnabled(false)
|
||||
//设置旋转手势是否可用。
|
||||
uiSettings.setRotateGesturesEnabled(false)
|
||||
//设置比例尺控件是否可见
|
||||
uiSettings.setScaleControlsEnabled(true)
|
||||
//设置拖拽手势是否可用。
|
||||
uiSettings.setScrollGesturesEnabled(true)
|
||||
//设置倾斜手势是否可用。
|
||||
uiSettings.setTiltGesturesEnabled(true)
|
||||
//设置缩放按钮是否可见。
|
||||
uiSettings.setZoomControlsEnabled(false)
|
||||
//设置双指缩放手势是否可用。
|
||||
uiSettings.setZoomGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMapBiz() {
|
||||
// TODO 临时初始化地图监听工控机、OBU等数据监听器,用于感知元素绘制
|
||||
MapIdentifySubscriber.instance
|
||||
MogoRouteOverlayManager.getInstance().init()
|
||||
MapPointCloudSubscriber.instance
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
}
|
||||
|
||||
override fun getUIController(): IMogoMapUIController {
|
||||
return mMogoMap!!.uiController
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
CallerSkinModeListenerManager.removeListener(Companion.functionName)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName)
|
||||
CallerChassisLamplightListenerManager.removeListener(Companion.functionName)
|
||||
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView!!.onDestroy()
|
||||
mMogoMapView = null
|
||||
mMogoMap = null
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
override fun changeMaoViewAngle(type: Int) {
|
||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
||||
mMogoMapView!!.map.uiController.changeMapViewAngle(type)
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeCurrentIcon(iconId: Int) {
|
||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
||||
mMogoMapView!!.map.uiController.changeCurrentIcon(iconId)
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
override fun setMapDAngle(mode: Int) {
|
||||
val angle = getSightModeAngle(mode)
|
||||
if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
||||
mMogoMapView!!.map.uiController.setMapDAngle(angle)
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
}
|
||||
}
|
||||
|
||||
private fun getSightModeAngle(mode: Int): Float { //todo 宏宇
|
||||
var angle = 0.0f
|
||||
when (mode) {
|
||||
SIGHT_MODE_NORMAL -> {
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
}
|
||||
SIGHT_MODE_TOP -> {
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
}
|
||||
SIGHT_MODE_BACK -> {
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
}
|
||||
SIGHT_MODE_CROSS -> {
|
||||
angle = 16.5f
|
||||
angle = 16.5f
|
||||
}
|
||||
SIGHT_MODE_FAR -> angle = 16.5f
|
||||
}
|
||||
return angle
|
||||
}
|
||||
|
||||
override fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine? {
|
||||
return if (mMogoMapView != null && mMogoMapView!!.map != null && mMogoMapView!!.map.uiController != null) {
|
||||
mMogoMapView!!.map.uiController.getCenterLineInfo(lon, lat, angle)
|
||||
} else {
|
||||
e(SceneConstant.M_MAP + Companion.functionName, "mMogoMapView is null")
|
||||
null //上层使用应该判空
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
if (skinMode == 0) {
|
||||
CallerHDMapManager.stepInVrMode(false)
|
||||
} else if (skinMode == 1) {
|
||||
CallerHDMapManager.stepInVrMode(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setPointCloudSize(pointCloudSize: Float) {
|
||||
//设置点云大小
|
||||
PointCloudHelper.setPointCloudSize(pointCloudSize)
|
||||
}
|
||||
|
||||
override fun setPointCloudColor(color: String) {
|
||||
// 设置点云颜色
|
||||
PointCloudHelper.setPointCloudColor(color)
|
||||
}
|
||||
|
||||
override fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
|
||||
try {
|
||||
// 是否绘制点云
|
||||
PointCloudHelper.setIsDrawPointCloud(isDrawPointCloud)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置地图是否是Debug模式
|
||||
*
|
||||
* @param debugMode 是否开启Debug模式
|
||||
*/
|
||||
override fun setDebugMode(debugMode: Boolean) {
|
||||
MapAutoApi.setDebugMode(debugMode)
|
||||
}
|
||||
|
||||
override val functionName: String
|
||||
get() = functionName
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
mMogoMapView?.setExtraGPSData(gnssInfo)
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
lightSwitch?.let {
|
||||
when (it.number) {
|
||||
1 -> { //左转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
2 -> { //右转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
else -> {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.mogo.eagle.core.function.map;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MapPresenter extends Presenter<MapView> {
|
||||
|
||||
private static final String TAG = "MapPresenter";
|
||||
|
||||
public MapPresenter(MapView view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.eagle.core.function.map;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 地图view
|
||||
*/
|
||||
public interface MapView extends IView {
|
||||
|
||||
/**
|
||||
* 地图控制接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoMapUIController getUIController();
|
||||
}
|
||||
@@ -13,13 +13,10 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNaviView;
|
||||
import com.autonavi.amap.mapcore.IPoint;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 包名: com.amap.api.navi.core
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.function.view.R
|
||||
import kotlinx.android.synthetic.main.view_maker_with_count.view.*
|
||||
|
||||
class MakerWithCount @JvmOverloads constructor(
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.view.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.function.view.R
|
||||
|
||||
class V2XMarkerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.function.view.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.map.MogoMapView
|
||||
|
||||
|
||||
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs), IMoGoSkinModeChangeListener,
|
||||
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener , LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "MapBizView"
|
||||
}
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
map?.uiController?.showMyLocation(true)
|
||||
initMapView()
|
||||
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
|
||||
}
|
||||
|
||||
private fun initMapView(){
|
||||
map?.uiSettings?.let {
|
||||
//设置所有手势是否可用
|
||||
it.setAllGesturesEnabled(true)
|
||||
//设置指南针是否可见。
|
||||
it.setCompassEnabled(false)
|
||||
//设置室内地图楼层切换控件是否可见。
|
||||
it.setIndoorSwitchEnabled(true)
|
||||
//设置定位按钮是否可见。
|
||||
it.setMyLocationButtonEnabled(false)
|
||||
//设置旋转手势是否可用。
|
||||
it.setRotateGesturesEnabled(false)
|
||||
//设置比例尺控件是否可见
|
||||
it.setScaleControlsEnabled(true)
|
||||
//设置拖拽手势是否可用。
|
||||
it.setScrollGesturesEnabled(true)
|
||||
//设置倾斜手势是否可用。
|
||||
it.setTiltGesturesEnabled(true)
|
||||
//设置缩放按钮是否可见。
|
||||
it.setZoomControlsEnabled(false)
|
||||
//设置双指缩放手势是否可用。
|
||||
it.setZoomGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle?) {
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
if (skinMode == 0) {
|
||||
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
|
||||
} else if (skinMode == 1) {
|
||||
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
setExtraGPSData(gnssInfo)
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
lightSwitch?.let {
|
||||
when (it.number) {
|
||||
1 -> { //左转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
2 -> { //右转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
else -> {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// 先取消注册数据,再onDestroy
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.overview.view
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
@@ -16,7 +16,6 @@ import com.amap.api.maps.CameraUpdate
|
||||
import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.TextureMapView
|
||||
import com.amap.api.maps.model.*
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -29,7 +28,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20Lis
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.function.smp.MakerWithCount
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
|
||||
@@ -318,7 +316,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
val center = v2xEvent.center
|
||||
if (center != null) {
|
||||
val markerOption = MarkerOptions()
|
||||
var latLng: LatLng =
|
||||
val latLng: LatLng =
|
||||
if (v2xEvent.coordinateType == null || v2xEvent.coordinateType == 0) {
|
||||
LatLng(center.lat, center.lon)
|
||||
} else {
|
||||
@@ -584,12 +582,15 @@ class OverMapView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
mLocation = gnssInfo
|
||||
lonLat = Pair(gnssInfo!!.longitude, gnssInfo.latitude)
|
||||
drawCarMarker(gnssInfo)
|
||||
if (isFirstLocation) {
|
||||
displayCustomOverView()
|
||||
isFirstLocation = false
|
||||
gnssInfo?.let {
|
||||
mLocation = it
|
||||
lonLat = Pair(it.longitude, it.latitude)
|
||||
drawCarMarker(it)
|
||||
if (isFirstLocation) {
|
||||
displayCustomOverView()
|
||||
isFirstLocation = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<com.mogo.map.MogoMapView
|
||||
android:id="@+id/module_map_id_map"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user