[3.4.0-map-sdk] update ,wait to test

This commit is contained in:
zhongchao
2023-08-29 17:06:14 +08:00
parent b421d2dc3f
commit 6bef1de3fc
90 changed files with 1272 additions and 3766 deletions

View File

@@ -1,69 +0,0 @@
package com.mogo.map;
import com.mogo.map.center.CenterLine;
import com.mogo.map.overlay.line.Polyline;
import com.mogo.map.overlay.point.Point;
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
import com.mogo.map.overlay.proxy.point.IMapPointOverlay;
import com.mogo.map.road.RoadNameInfo;
import com.mogo.map.uicontroller.IMogoMapUIController;
import java.util.HashMap;
import mogo.telematics.pad.MessagePad;
import mogo.yycp.api.proto.SocketDownData;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* 地图控制接口
*/
public interface IMogoMap {
/**
* 获取地图ui控制器可以控制内置ui缩放按钮、指北针等是否显示及部分手势滑动、双指缩放等是否可用。
*
* @return
*/
IMogoUiSettings getUiSettings();
/**
* 操作地图视图
*
* @return
*/
IMogoMapUIController getUIController();
IMapPointOverlay addPoint(Point.Options options);
IMapPolylineOverlay addLine(Polyline.Options options);
/**
* 批量更新锚点位置
*
* @param optionsArrayList 锚点集合
*/
void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList);
/**
* 批量更新锚点位置
*
* @param optionsArrayList 锚点集合
*/
void updateBatchAiMarkerPosition(HashMap<String, SocketDownData.CloudRoadDataProto> optionsArrayList);
/**
* 添加感知使用到的3d模型
*
* @param type
* @param modelRes
*/
String addPreVehicleModel(int type, int modelRes);
/**
* 要移除的感知数据uuid
*
* @param uuidString
*/
void removeMarker(String uuidString);
}

View File

@@ -0,0 +1,66 @@
package com.mogo.map
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
import java.util.HashMap
/**
* @author congtaowang
* @since 2019-12-18
*
*
* 地图控制接口
*/
interface IMogoMap {
/**
* 获取地图ui控制器可以控制内置ui缩放按钮、指北针等是否显示及部分手势滑动、双指缩放等是否可用。
*
* @return
*/
val uiSettings: IMogoUiSettings?
/**
* 操作地图视图
*
* @return
*/
val uiController: IMogoMapUIController?
fun addPoint(options: Point.Options?): IMapPointOverlay?
fun addLine(options: Polyline.Options?): IMapPolylineOverlay?
/**
* 批量更新锚点位置
*
* @param optionsArrayList 锚点集合
*/
fun updateBatchMarkerPosition(optionsArrayList: HashMap<String?, TrackedObject?>?)
/**
* 批量更新锚点位置
*
* @param optionsArrayList 锚点集合
*/
fun updateBatchAiMarkerPosition(optionsArrayList: HashMap<String?, SocketDownData.CloudRoadDataProto?>?)
/**
* 添加感知使用到的3d模型
*
* @param type
* @param modelRes
*/
fun addPreVehicleModel(type: Int, modelRes: Int): String?
/**
* 要移除的感知数据uuid
*
* @param uuidString
*/
fun removeMarker(uuidString: String?)
}

View File

@@ -1,13 +0,0 @@
package com.mogo.map.center
import android.util.Pair
data class CenterLine(
var id: String = "", //id
var tile_id: String = "", //瓦片id
var road_id: String = "", //道路id
var lane_id: String = "", //车道id
var points: List<Pair<Double, Double>> = emptyList(),
var angle: Double = 0.0
)

View File

@@ -3,7 +3,6 @@ package com.mogo.map.listener;
import android.view.MotionEvent;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.VisualAngleMode;
@@ -29,14 +28,6 @@ public interface IMogoMapListener {
default void onTouch(MotionEvent motionEvent) {
}
/**
* 地图上的任意poi点击
*
* @param poi
*/
default void onPOIClick(MogoPoi poi) {
}
/**
* 地图点击
*

View File

@@ -2,7 +2,6 @@ package com.mogo.map.listener
import android.view.MotionEvent
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.map.model.MogoPoi
import com.mogo.map.uicontroller.EnumMapUI
import com.mogo.map.uicontroller.VisualAngleMode
import java.util.concurrent.ConcurrentHashMap
@@ -48,13 +47,6 @@ class MogoMapListenerHandler private constructor() : IMogoMapListener, IMogoMapL
}
}
override fun onPOIClick(poi: MogoPoi) {
mMap.forEach {
val listener = it.value
listener.onPOIClick(poi)
}
}
override fun onMapClick(latLng: MogoLatLng) {
mMap.forEach {
val listener = it.value

View File

@@ -1,76 +0,0 @@
package com.mogo.map.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.mogo.eagle.core.data.map.MogoLatLng;
/**
* @author congtaowang
* @since 2019-12-24
* <p>
* 地图上的poi
*/
public class MogoPoi implements Parcelable {
private String name;
private MogoLatLng coordinate;
private String poiId;
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
public MogoLatLng getCoordinate() {
return coordinate;
}
public void setCoordinate( MogoLatLng coordinate ) {
this.coordinate = coordinate;
}
public String getPoiId() {
return poiId;
}
public void setPoiId( String poiId ) {
this.poiId = poiId;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel( Parcel dest, int flags ) {
dest.writeString( this.name );
dest.writeParcelable( this.coordinate, flags );
dest.writeString( this.poiId );
}
public MogoPoi() {
}
protected MogoPoi( Parcel in ) {
this.name = in.readString();
this.coordinate = in.readParcelable( MogoLatLng.class.getClassLoader() );
this.poiId = in.readString();
}
public static final Parcelable.Creator< MogoPoi > CREATOR = new Parcelable.Creator< MogoPoi >() {
@Override
public MogoPoi createFromParcel( Parcel source ) {
return new MogoPoi( source );
}
@Override
public MogoPoi[] newArray( int size ) {
return new MogoPoi[size];
}
};
}

View File

@@ -1,3 +0,0 @@
package com.mogo.map.road
data class RoadNameInfo(val tile_id: String? = "", val road_id: String? = "", val road_name: String? = "")

View File

@@ -1,127 +1,119 @@
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.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import java.util.List;
package com.mogo.map.uicontroller
import android.graphics.Point
import android.graphics.Rect
import android.view.View
import androidx.annotation.RawRes
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.map.MogoLocation
/**
* @author congtaowang
* @since 2019-12-26
* <p>
*
*
* 地图UI控制
*/
public interface IMogoMapUIController {
interface IMogoMapUIController {
/**
* 修改缩放级别
*/
MapControlResult changeZoom(float zoom);
fun changeZoom(zoom: Float): MapControlResult
/**
* 修改缩放级别的另一种方式
* @param zoom 缩放比例
*/
void changeZoom2(float zoom);
fun changeZoom2(zoom: Float)
/**
* 进入VR 模式
* 进入黑夜/白天 模式
*
* @param isDayMode true-白天模式false-夜间模式
*/
void stepInVrMode(boolean isDayMode);
fun stepInDayMode(isDayMode: Boolean)
/**
* 切换3D模式下远距中距近距视角
*
* @param angelMode {@link VisualAngleMode}
* @param angelMode [VisualAngleMode]
*/
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
fun changeMapVisualAngle(angelMode: VisualAngleMode, mogoLatLng: MogoLatLng?)
/**
* 设置漫游路径
* @param trajectory
*/
void setRoamTrajectory(String trajectory);
fun setRoamTrajectory(trajectory: String)
/**
* 设置漫游模式 , 0:自由漫游1:路径漫游
*/
void setRomaMode(int mode);
fun setRomaMode(mode: Int)
/**
* 获得当前地图视距模式
*
* @return {@link VisualAngleMode}
* @return [VisualAngleMode]
*/
VisualAngleMode getCurrentMapVisualAngle();
val currentMapVisualAngle: VisualAngleMode
/**
* 将地图移动至当前位置
*/
default void moveToCenter(MogoLatLng latLng) {
moveToCenter(latLng, false);
fun moveToCenter(latLng: MogoLatLng) {
moveToCenter(latLng, false)
}
/**
* 将地图移动至当前位置
*/
void moveToCenter(MogoLatLng latLng, boolean animate);
fun moveToCenter(latLng: MogoLatLng, animate: Boolean)
/**
* 是否白天模式
* @return
*/
boolean isDayMode();
val isDayMode: Boolean
/**
* 显示我的位置
*
* @param visible true - 显示 false - 不显示
*/
void showMyLocation(boolean visible);
fun showMyLocation(visible: Boolean)
/**
* @param view
*/
void showMyLocation(View view);
fun showMyLocation(view: View)
/**
* 获取比例尺数据
*
* @return 当前缩放级别下地图上1像素点对应的长度单位米
*/
float getScalePerPixel();
val scalePerPixel: Float
/**
* 获取缩放比例
*/
float getZoomLevel();
val zoomLevel: Float
/**
* 获取视图东北角坐标
*/
MogoLatLng getCameraNorthEastPosition();
val cameraNorthEastPosition: MogoLatLng?
/**
* 获取视图西南角坐标
*/
MogoLatLng getCameraSouthWestPosition();
val cameraSouthWestPosition: MogoLatLng?
/**
* 获取视图中心点坐标
*/
MogoLatLng getWindowCenterLocation();
val windowCenterLocation: MogoLatLng?
/**
* 设置地图中心点
@@ -129,22 +121,22 @@ public interface IMogoMapUIController {
* @param mapCenterX x 点位置x值与地图宽度的比例
* @param mapCenterY y 点位置x值与地图高度的比例
*/
void setPointToCenter(double mapCenterX, double mapCenterY);
fun setPointToCenter(mapCenterX: Double, mapCenterY: Double)
/**
* 获取经纬度对应的屏幕的位置
*/
Point getLocationPointInScreen(MogoLatLng latLng);
fun getLocationPointInScreen(latLng: MogoLatLng): Point?
/**
* 获取像素点对应的经纬度
*/
MogoLatLng getLocationMogoLatLngInScreen(Point point);
fun getLocationMogoLatLngInScreen(point: Point): MogoLatLng?
/**
* 设置刷新帧率
*/
void setRenderFps(int fps);
fun setRenderFps(fps: Int)
/**
* @param tag 调用业务
@@ -153,12 +145,18 @@ public interface IMogoMapUIController {
* @param bound 地图上可显示的范围
* @param lockCarPosition 是否锁定车辆位置
*/
void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition);
fun showBounds(
tag: String,
carPosition: MogoLatLng,
lonLats: List<MogoLatLng>,
bound: Rect,
lockCarPosition: Boolean
)
/**
* 强制刷新地图
*/
void forceRender();
fun forceRender()
/**
* 计算两点之间的距离
@@ -167,131 +165,117 @@ public interface IMogoMapUIController {
* @param p2
* @return
*/
float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception;
fun calculateLineDistance(p1: MogoLatLng, p2: MogoLatLng): Float
/**
* 锁车状态
*
* @return
*/
boolean isCarLocked();
val isCarLocked: Boolean
/**
* 配置自车图标样式
*
* @param option 为空时使用
* 默认配置
* 默认配置
*/
void setCarCursorOption(@Nullable CarCursorOption option);
fun setCarCursorOption(option: CarCursorOption)
/**
* @param type :车尾灯类型 0=默认 1=左黄 2=右黄 3=双黄 4=双红
* @param time: 闪烁时间 最小500ms 小于500ms 默认为500ms
*/
void setCarLightsType(int type, int time);
fun setCarLightsType(type: Int, time: Int)
/**
* 获取地图视图描述快照
*
* @return
*/
MapCameraPosition getMapCameraPosition();
val mapCameraPosition: MapCameraPosition?
/**
* 切换地图视图视角
*
* @param bearing
*/
void changeBearing(float bearing);
fun changeBearing(bearing: Float)
/**
* 修改高精地图自车图标
* 传入资源ID
*/
void changeCurrentIcon(@RawRes int iconId);
fun changeCurrentIcon(@RawRes iconId: Int)
/**
* 自研地图是否匹配道路
*
* @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) {
}
fun rtkEnable(enable: Boolean) {}
fun destroy() {}
/**
* 设置地图视线角度
*/
void setMapDAngle(float angle);
fun setMapDAngle(angle: Float)
/**
* 设置锁屏模式
*/
void setLockMode(boolean isLock);
fun setLockMode(isLock: Boolean)
/**
* 设置手势滑动失效
*/
void setScrollGesturesEnable(boolean isEnable);
fun setScrollGesturesEnable(isEnable: Boolean)
/**
* 设置所有的滑动失效
*/
void setAllGesturesEnabled(boolean isEnable);
fun setAllGesturesEnabled(isEnable: Boolean)
/**
* 设置外界坐标系
*
* @param gnssInfo RTK 高精坐标车辆惯导数据
*/
void setExtraGPSData(MogoLocation gnssInfo);
fun setExtraGPSData(gnssInfo: MogoLocation)
/**
* 打开点云绘制
*
* @param isDrawPointCloud 是否绘制点云
*/
void setIsDrawPointCloud(Boolean isDrawPointCloud);
fun setIsDrawPointCloud(isDrawPointCloud: Boolean)
/**
* 设制点云大小
*
* @param pointCloudSize 点云的点大小
*/
void setPointCloudSize(Float pointCloudSize);
fun setPointCloudSize(pointCloudSize: Float)
/**
* 设置点云颜色
*
* @param color // color:"#RRGGBB*
*/
void setPointCloudColor(String color);
fun setPointCloudColor(color: String)
String getCityCode();
/**
* 更新点云数据
* @param dataStr 点云数据
* @param isTrasformer 是否需要转换坐标
* @param isResidual 是否需要差量更新
* @param isStrong 是否加粗显示
* @return 是否执行
*/
fun updatePointCloud(
dataArray: ByteArray?, isTrasformer: Boolean,
isResidual: Boolean, isReset: Boolean
): Boolean
/**
* 自动切换视角到指定点包含过渡动画并持续指定duration毫秒
@@ -302,8 +286,7 @@ public interface IMogoMapUIController {
* @param duration 持续时间
* @param isGps 是否是高精坐标
*/
void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps);
fun animateTo(lon: Double, lat: Double, rotateAngle: Float, duration: Int, isGps: Boolean)
/**
* 自动切换视角到指定点包含过渡动画并持续指定duration毫秒
@@ -315,10 +298,13 @@ public interface IMogoMapUIController {
* @param v3
* @param v4
*/
void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps);
fun animateTo(
lon: Double, lat: Double, v1: Float, v2: Float,
v3: Float, v4: Float, duration: Int, isGps: Boolean
)
/**
* 从地图上删除所有的overlaymarkercirclepolyline 等对象
*/
void clear();
}
fun clear()
}