[3.4.0-map-sdk] merge
This commit is contained in:
@@ -25,7 +25,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
@@ -53,7 +52,6 @@ import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ import com.mogo.och.sweepercloud.util.SweeperCloudTaskUtils;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
|
||||
@@ -19,7 +19,6 @@ class TrafficLightNetWorkModel {
|
||||
}
|
||||
|
||||
fun requestRoadID(
|
||||
tileID: Long,
|
||||
lat: Double,
|
||||
lon: Double,
|
||||
bearing: Double,
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XRoadEventScena
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.warning.V2XFrontWarningScenario;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
|
||||
|
||||
@@ -3,12 +3,11 @@ package com.mogo.eagle.core.function.api.autopilot
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable.IsBootableResp
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTaskSuspendResume.SuspendResumeTaskResp
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus.BigTaskStatusPush
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm.TaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus.TaskStatusPush
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop.StopTaskReq
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* 清扫车(福田)云端任务接口
|
||||
@@ -65,7 +64,7 @@ interface IMoGoSweeperFutianCloudTaskListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param suspendResumeTaskResp 数据
|
||||
*/
|
||||
fun onSweeperFutianCloudTaskSuspendResume(messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, suspendResumeTaskResp: SuspendResumeTaskResp?)
|
||||
fun onSweeperFutianCloudTaskSuspendResume(messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, suspendResumeTaskResp: SweeperTaskSuspendResume.SuspendResumeTaskResp?)
|
||||
|
||||
/**
|
||||
* 8、接管后回自驾-pad上报状态给云端 云端下发启动自驾(type: 100008)-> sweeper_autopilot.proto
|
||||
|
||||
@@ -5,10 +5,9 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
|
||||
@@ -124,21 +123,6 @@ object CallerSweeperFutianCloudTaskListenerManager : CallerBase<IMoGoSweeperFuti
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 10、云端下发任务暂停/恢复指令到pad(type: 100010)-> sweeper_task_cloud_suspend_resume.proto
|
||||
*
|
||||
* @param messageType 消息类型
|
||||
* @param reqNo 请求编号
|
||||
* @param sysTime 当前时间戳
|
||||
* @param bigTaskActionPush 数据
|
||||
*/
|
||||
fun invokeSweeperFutianCloudTaskCloudSuspendResume(messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, bigTaskActionPush: SweeperTaskCloudSuspendResume.BigTaskActionPush?) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onSweeperFutianCloudTaskCloudSuspendResume(messageType, reqNo, sysTime, bigTaskActionPush)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车云端任务未知类型
|
||||
*
|
||||
|
||||
@@ -1,411 +0,0 @@
|
||||
package com.mogo.map.uicontroller;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
* 地图UI控制
|
||||
*/
|
||||
public interface IMogoMapUIController {
|
||||
|
||||
|
||||
/**
|
||||
* 修改缩放级别
|
||||
*/
|
||||
MapControlResult changeZoom(float zoom);
|
||||
|
||||
|
||||
/**
|
||||
* 修改缩放级别的另一种方式
|
||||
* @param zoom 缩放比例
|
||||
*/
|
||||
void changeZoom2(float zoom);
|
||||
|
||||
/**
|
||||
* 设置地图是否是Debug模式
|
||||
*
|
||||
* @param debugMode 是否开启Debug模式
|
||||
*/
|
||||
void setDebugMode(Boolean debugMode);
|
||||
|
||||
/**
|
||||
* 进入VR 模式
|
||||
*
|
||||
* @param isDayMode true-白天模式,false-夜间模式
|
||||
*/
|
||||
void stepInVrMode(boolean isDayMode);
|
||||
|
||||
/**
|
||||
* 切换3D模式下远距,中距,近距视角
|
||||
*
|
||||
* @param angelMode {@link VisualAngleMode}
|
||||
*/
|
||||
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
|
||||
|
||||
/**
|
||||
* 切换视角锁定,用于启动/关闭漫游
|
||||
* @param lock 锁定值
|
||||
*/
|
||||
void visualAngleLock(boolean lock);
|
||||
|
||||
/**
|
||||
* 设置漫游路径
|
||||
* @param trajectory
|
||||
*/
|
||||
void setRoamTrajectory(String trajectory);
|
||||
|
||||
/**
|
||||
* 设置漫游模式 , 0:自由漫游,1:路径漫游
|
||||
*/
|
||||
void setRomaMode(int mode);
|
||||
|
||||
/**
|
||||
* 获得当前地图视距模式
|
||||
*
|
||||
* @return {@link VisualAngleMode}
|
||||
*/
|
||||
VisualAngleMode getCurrentMapVisualAngle();
|
||||
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
default void moveToCenter(MogoLatLng latLng) {
|
||||
moveToCenter(latLng, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
void moveToCenter(MogoLatLng latLng, boolean animate);
|
||||
|
||||
/**
|
||||
* 是否白天模式
|
||||
* @return
|
||||
*/
|
||||
boolean isDayMode();
|
||||
|
||||
/**
|
||||
* 显示我的位置
|
||||
*
|
||||
* @param visible true - 显示 false - 不显示
|
||||
*/
|
||||
void showMyLocation(boolean visible);
|
||||
|
||||
/**
|
||||
* @param view
|
||||
*/
|
||||
void showMyLocation(View view);
|
||||
|
||||
/**
|
||||
* 获取比例尺数据
|
||||
*
|
||||
* @return 当前缩放级别下,地图上1像素点对应的长度,单位米
|
||||
*/
|
||||
float getScalePerPixel();
|
||||
|
||||
/**
|
||||
* 获取缩放比例
|
||||
*/
|
||||
float getZoomLevel();
|
||||
|
||||
/**
|
||||
* 获取道路的宽度
|
||||
*/
|
||||
float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK);
|
||||
|
||||
/**
|
||||
* 获取视图东北角坐标
|
||||
*/
|
||||
MogoLatLng getCameraNorthEastPosition();
|
||||
|
||||
/**
|
||||
* 获取视图西南角坐标
|
||||
*/
|
||||
MogoLatLng getCameraSouthWestPosition();
|
||||
|
||||
/**
|
||||
* 获取视图中心点坐标
|
||||
*/
|
||||
MogoLatLng getWindowCenterLocation();
|
||||
|
||||
/**
|
||||
* 设置地图中心点
|
||||
*
|
||||
* @param mapCenterX x 点位置x值与地图宽度的比例
|
||||
* @param mapCenterY y 点位置x值与地图高度的比例
|
||||
*/
|
||||
void setPointToCenter(double mapCenterX, double mapCenterY);
|
||||
|
||||
/**
|
||||
* 获取经纬度对应的屏幕的位置
|
||||
*/
|
||||
Point getLocationPointInScreen(MogoLatLng latLng);
|
||||
|
||||
/**
|
||||
* 获取像素点对应的经纬度
|
||||
*/
|
||||
MogoLatLng getLocationMogoLatLngInScreen(Point point);
|
||||
|
||||
/**
|
||||
* 设置刷新帧率
|
||||
*/
|
||||
void setRenderFps(int fps);
|
||||
|
||||
/**
|
||||
* @param tag 调用业务
|
||||
* @param carPosition 当前位置
|
||||
* @param lonLats 经纬度围成的范围
|
||||
* @param bound 地图上可显示的范围
|
||||
* @param lockCarPosition 是否锁定车辆位置
|
||||
*/
|
||||
void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition);
|
||||
|
||||
/**
|
||||
* 强制刷新地图
|
||||
*/
|
||||
void forceRender();
|
||||
|
||||
/**
|
||||
* 计算两点之间的距离
|
||||
*
|
||||
* @param p1
|
||||
* @param p2
|
||||
* @return
|
||||
*/
|
||||
float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception;
|
||||
|
||||
/**
|
||||
* 锁车状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isCarLocked();
|
||||
|
||||
/**
|
||||
* 配置自车图标样式
|
||||
*
|
||||
* @param option 为空时使用
|
||||
* 默认配置
|
||||
*/
|
||||
void setCarCursorOption(@Nullable CarCursorOption option);
|
||||
|
||||
/**
|
||||
* @param type :车尾灯类型 0=默认 1=左黄 2=右黄 3=双黄 4=双红
|
||||
* @param time: 闪烁时间 最小500ms 小于500ms 默认为500ms
|
||||
*/
|
||||
void setCarLightsType(int type, int time);
|
||||
|
||||
/**
|
||||
* 获取地图视图描述快照
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MapCameraPosition getMapCameraPosition();
|
||||
|
||||
/**
|
||||
* 切换地图视图视角
|
||||
*
|
||||
* @param bearing
|
||||
*/
|
||||
void changeBearing(float bearing);
|
||||
|
||||
/**
|
||||
* 修改地图中心
|
||||
* MapAutoApi.CAR_CENTER_100 = 1
|
||||
* MapAutoApi.CAR_QUARTER_100 = 2
|
||||
* MapAutoApi.CAR_TWO_FIFTHS_100 = 3
|
||||
* MapAutoApi.CAR_TWO_FIFTHS_80= 4
|
||||
* MapAutoApi.CAR_AFTER_30_FRONT_80 = 5
|
||||
* MapAutoApi.CAR_AFTER_30_FRONT_100 = 6
|
||||
* MapAutoApi.CAR_AFTER_30_FRONT_120 = 7
|
||||
* MapAutoApi.CAR_AFTER_40_FRONT_80= 8
|
||||
* MapAutoApi.CAR_AFTER_40_FRONT_100 = 9
|
||||
* MapAutoApi.CAR_AFTER_40_FRONT_120 = 10
|
||||
*/
|
||||
void changeMapViewAngle(int type);
|
||||
|
||||
/**
|
||||
* 修改高精地图自车图标
|
||||
* 传入资源ID
|
||||
*/
|
||||
void changeCurrentIcon(@RawRes int iconId);
|
||||
|
||||
/**
|
||||
* 获取瓦片id
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @return 瓦片id
|
||||
*/
|
||||
long getTileId(double lon, double lat);
|
||||
|
||||
|
||||
/**
|
||||
* 获取限速
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @return
|
||||
*/
|
||||
int getLimitSpeed(double lon, double lat, float angle);
|
||||
|
||||
/**
|
||||
* 获取车道中心线信息
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @return
|
||||
*/
|
||||
CenterLine getCenterLineInfo(double lon, double lat, float angle);
|
||||
|
||||
/**
|
||||
* 自研地图是否匹配道路
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
default void rtkEnable(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
default void destroy() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
*
|
||||
* @param speedVal
|
||||
* @return
|
||||
*/
|
||||
default String getMarkerInfoResName(String speedVal) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
*
|
||||
* @param speedVal
|
||||
* @return
|
||||
*/
|
||||
default void setMarkerInfoResName(String speedVal, String val) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置地图视线角度
|
||||
*/
|
||||
void setMapDAngle(float angle);
|
||||
|
||||
/**
|
||||
* 获取行车方向
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
float getAngle(double startLon, double startLat, double endLon, double endLat);
|
||||
|
||||
/**
|
||||
* 获取当前道路方向
|
||||
*
|
||||
* @return angle
|
||||
*/
|
||||
Double getRoadAngle(Double lon, Double lat, float angle);
|
||||
|
||||
/**
|
||||
* 设置锁屏模式
|
||||
*/
|
||||
void setLockMode(boolean isLock);
|
||||
|
||||
/**
|
||||
* 设置手势滑动失效
|
||||
*/
|
||||
void setScrollGesturesEnable(boolean isEnable);
|
||||
|
||||
/**
|
||||
* 设置所有的滑动失效
|
||||
*/
|
||||
void setAllGesturesEnabled(boolean isEnable);
|
||||
|
||||
/**
|
||||
* 设置外界坐标系
|
||||
*
|
||||
* @param gnssInfo RTK 高精坐标,车辆惯导数据
|
||||
*/
|
||||
void setExtraGPSData(MogoLocation gnssInfo);
|
||||
|
||||
/**
|
||||
* 打开点云绘制
|
||||
*
|
||||
* @param isDrawPointCloud 是否绘制点云
|
||||
*/
|
||||
void setIsDrawPointCloud(Boolean isDrawPointCloud);
|
||||
|
||||
/**
|
||||
* 设制点云大小
|
||||
*
|
||||
* @param pointCloudSize 点云的点大小
|
||||
*/
|
||||
void setPointCloudSize(Float pointCloudSize);
|
||||
|
||||
/**
|
||||
* 设置点云颜色
|
||||
*
|
||||
* @param color // color:"#RRGGBB*
|
||||
*/
|
||||
void setPointCloudColor(String color);
|
||||
void cacheHDDataByCity(IHdCacheListener listener);
|
||||
|
||||
void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location);
|
||||
|
||||
/**
|
||||
* 当前城市离线数据是否已缓存
|
||||
* @return
|
||||
*/
|
||||
boolean isCityDataCached();
|
||||
|
||||
void cancelDownloadCacheData();
|
||||
|
||||
String getCityCode();
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param rotateAngle 旋转角度
|
||||
* @param duration 持续时间
|
||||
* @param isGps 是否是高精坐标
|
||||
*/
|
||||
void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps);
|
||||
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param v1 旋转角度
|
||||
* @param v2 持续时间
|
||||
* @param v3
|
||||
* @param v4
|
||||
*/
|
||||
void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps);
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager.invoke
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.invokeListenersOnRoadIdGet
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.invokeListenersOnStopLineGet
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener.invokeMapRomaStatus
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
|
||||
@@ -1,36 +1,26 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Point;
|
||||
import android.util.Pair;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.center.CenterLine;
|
||||
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
|
||||
import com.mogo.map.overlay.proxy.point.IMapPointOverlay;
|
||||
import com.mogo.map.overlay.wrapper.point.AMapPointWrapper;
|
||||
import com.mogo.map.road.RoadNameInfo;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BatchMarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerHelper;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.api.proto.SocketDownData;
|
||||
@@ -45,25 +35,16 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static MapAutoViewHelper sAMap;
|
||||
private final IMogoMapUIController mMapUIController;
|
||||
private MapAutoViewHelper mAMap;
|
||||
private final MapAutoView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
|
||||
public AMapWrapper(MapAutoViewHelper map, MapAutoView mapView, IMogoMapUIController controller) {
|
||||
CallerLogger.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
mMapUIController = controller;
|
||||
// 设置实现自定义 info window
|
||||
// MapAutoApi.INSTANCE.setInfoWindowAdapter(new AMapInfoWindowAdapter());
|
||||
AMapUIController.getInstance().initClient(mMapUIController);
|
||||
}
|
||||
|
||||
public static MapAutoViewHelper getAMap() {
|
||||
return sAMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,42 +59,42 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
public IMogoMapUIController getUiController() {
|
||||
return mMapUIController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMapPointOverlay addPoint(com.mogo.map.overlay.point.Point.Options options) {
|
||||
public IMapPointOverlay addPoint(@NonNull com.mogo.map.overlay.point.Point.Options options) {
|
||||
if (!checkAMap()) {
|
||||
return null;
|
||||
}
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo(options);
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo(options,mMapView);
|
||||
if (markerOptions == null) {
|
||||
CallerLogger.e(TAG, "marker参数为空");
|
||||
CallerLogger.INSTANCE.e(TAG, "marker参数为空");
|
||||
return null;
|
||||
}
|
||||
Marker delegate = mAMap.addMarker(markerOptions);
|
||||
if (delegate == null) {
|
||||
return null;
|
||||
}
|
||||
return new AMapPointWrapper(options.getId(), delegate);
|
||||
return new AMapPointWrapper(options.getId(), delegate,mMapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMapPolylineOverlay addLine(com.mogo.map.overlay.line.Polyline.Options options) {
|
||||
public IMapPolylineOverlay addLine(@NonNull com.mogo.map.overlay.line.Polyline.Options options) {
|
||||
if (!checkAMap()) {
|
||||
return null;
|
||||
}
|
||||
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options);
|
||||
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options,mMapView);
|
||||
if (polylineOptions == null) {
|
||||
CallerLogger.e(TAG, "polyline参数为空");
|
||||
CallerLogger.INSTANCE.e(TAG, "polyline参数为空");
|
||||
return null;
|
||||
}
|
||||
Polyline delegate = polylineOptions.lineWidth > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
|
||||
Polyline delegate = polylineOptions.getLineWidth() > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
|
||||
if (delegate == null) {
|
||||
return null;
|
||||
}
|
||||
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate);
|
||||
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate,mMapView);
|
||||
}
|
||||
|
||||
BatchMarkerOptions batchMarkerOptions = new BatchMarkerOptions();
|
||||
@@ -138,14 +119,15 @@ public class AMapWrapper implements IMogoMap {
|
||||
return;
|
||||
}
|
||||
long time = markerOptionsArrayList.get(0).getTime();
|
||||
batchMarkerOptions.list = markerOptionsArrayList;
|
||||
batchMarkerOptions.averageFlag = 0;
|
||||
batchMarkerOptions.delayStrategy = false;
|
||||
batchMarkerOptions.ruleAngle = 8.0f;
|
||||
batchMarkerOptions.controlIcon = 1;
|
||||
batchMarkerOptions.satelliteTime = time;
|
||||
batchMarkerOptions.deleteRule = 0;
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(batchMarkerOptions);
|
||||
batchMarkerOptions.setList(markerOptionsArrayList);
|
||||
batchMarkerOptions.setDelayStrategy(false);
|
||||
batchMarkerOptions.setRuleAngle(8.0f);
|
||||
batchMarkerOptions.setControlIcon(1);
|
||||
batchMarkerOptions.setSatelliteTime(time);
|
||||
batchMarkerOptions.setDeleteRule(0);
|
||||
if(mMapView.getMarkerController() != null){
|
||||
mMapView.getMarkerController().updateBatchMarkerPositon(batchMarkerOptions);
|
||||
}
|
||||
}
|
||||
|
||||
BatchMarkerOptions aiBatchMarkerOptions = new BatchMarkerOptions();
|
||||
@@ -171,19 +153,23 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
long time = markerOptionsArrayList.get(0).getTime();
|
||||
// 最后一个参数,是否管理锚点的删除
|
||||
aiBatchMarkerOptions.list = markerOptionsArrayList;
|
||||
aiBatchMarkerOptions.delayStrategy = false;
|
||||
aiBatchMarkerOptions.ruleAngle = 8.0f;
|
||||
aiBatchMarkerOptions.controlIcon = 1;
|
||||
aiBatchMarkerOptions.satelliteTime = time;
|
||||
aiBatchMarkerOptions.deleteRule = 0;
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(aiBatchMarkerOptions);
|
||||
aiBatchMarkerOptions.setList(markerOptionsArrayList);
|
||||
aiBatchMarkerOptions.setDelayStrategy(false);
|
||||
aiBatchMarkerOptions.setRuleAngle(8.0f);
|
||||
aiBatchMarkerOptions.setControlIcon(1);
|
||||
aiBatchMarkerOptions.setSatelliteTime(time);
|
||||
aiBatchMarkerOptions.setDeleteRule(0);
|
||||
if(mMapView.getMarkerController() != null) {
|
||||
mMapView.getMarkerController().updateBatchMarkerPositon(aiBatchMarkerOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addPreVehicleModel(int type, int modelRes) {
|
||||
try {
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
if(mMapView.getMarkerController() != null){
|
||||
return mMapView.getMarkerController().addPreVehicleModel(type, modelRes);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -193,120 +179,21 @@ public class AMapWrapper implements IMogoMap {
|
||||
@Override
|
||||
public void removeMarker(String uuidString) {
|
||||
try {
|
||||
MarkerHelper.INSTANCE.removeMarker(uuidString);
|
||||
if(mMapView.getMarkerController() != null){
|
||||
mMapView.getMarkerController().removeMarker(uuidString);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
if (checkAMap()) {
|
||||
mAMap.clearPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(boolean isKeepMyLocationOverlay) {
|
||||
if (checkAMap()) {
|
||||
mAMap.clearPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter(int x, int y) {
|
||||
if (checkAMap()) {
|
||||
LonLatPoint lonLatPoint = MapTools.INSTANCE.fromScreenLocation(new Point(x, y));
|
||||
mAMap.setCenter(lonLatPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (checkAMap()) {
|
||||
return mAMap.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom(float zoom) {
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoom((int) zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom2(float zoom) {
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoomVal(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if (checkAMap()) {
|
||||
try {
|
||||
return mAMap.getZoom();
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean checkAMap() {
|
||||
mAMap = mMapView.getMapAutoViewHelper();
|
||||
sAMap = mAMap;
|
||||
if (mAMap == null) {
|
||||
CallerLogger.e(TAG, "自研map实例为空,请检查");
|
||||
CallerLogger.INSTANCE.e(TAG, "自研map实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) {
|
||||
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(lon, lat, angle, isGpsLocation, isRTK);
|
||||
|
||||
return singlePointRoadInfo != null ? singlePointRoadInfo.getLaneWidth() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance) {
|
||||
try {
|
||||
com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance);
|
||||
CenterLine ret = null;
|
||||
if (info != null) {
|
||||
ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle);
|
||||
}
|
||||
return ret;
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoadNameInfo getRoadName(double lon, double lat, float angle) {
|
||||
// com.zhidaoauto.map.sdk.open.road.RoadNameInfo info = MapDataApi.INSTANCE.getRoadName(lon, lat, angle);
|
||||
// RoadNameInfo ret = null;
|
||||
// if (info != null) {
|
||||
// ret = new RoadNameInfo(info.tile_id, info.road_id, info.road_name);
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Pair<Double, Double>> convert(List<LonLatPoint> points) {
|
||||
if (points == null || points.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Pair<Double, Double>> ret = new ArrayList<>(points.size());
|
||||
for (LonLatPoint p : points) {
|
||||
ret.add(Pair.create(p.longitude, p.latitude));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapStyleParams;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user