This commit is contained in:
lixiaopeng
2021-03-31 16:49:11 +08:00
parent 7290d41b2b
commit 9cd0b09a4b
9 changed files with 25 additions and 6 deletions

View File

@@ -253,6 +253,11 @@ public class AMapWrapper implements IMogoMap {
return true;
}
@Override
public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) {
return 0;
}
private Context getContext() {
return mContext;
}

View File

@@ -20,6 +20,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
import com.zhidaoauto.map.sdk.open.marker.Marker;
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
import com.zhidaoauto.map.sdk.open.marker.MultiPointOverlayOptions;
@@ -275,6 +276,13 @@ public class AMapWrapper implements IMogoMap {
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.getLaneWidth();
}
private Context getContext() {
return mMapView.getContext();
}

View File

@@ -130,6 +130,11 @@ public interface IMogoMap {
*/
float getZoomLevel();
/**
* 获取道路的宽度
*/
float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK);
/**
* 添加线段
*

View File

@@ -121,6 +121,7 @@ public interface IMogoMapUIController {
*/
float getZoomLevel();
/**
* 获取视图东北角坐标
*/

View File

@@ -101,7 +101,7 @@ public class V2XWaringManager {
MogoLatLng endLatlng1 = new MogoLatLng(40.010906,116.423821);
info1.setStartLocation(startLatlng1);
info1.setEndLocation(endLatlng1);
V2XServiceManager.getMoGoWarnPolylineManager().drawaWarnPolyline(getContext(), info1);
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info1);
// adas 每隔一秒传递的他车或行人数据
V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
@@ -117,7 +117,7 @@ public class V2XWaringManager {
MogoLatLng endLatlng = new MogoLatLng(39.971089,116.407384);
info.setStartLocation(startLatlng);
info.setEndLocation(endLatlng);
V2XServiceManager.getMoGoWarnPolylineManager().drawaWarnPolyline(mContext, info);
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(mContext, info);
//更新数据
for (ADASRecognizedResult result : resultList) {

View File

@@ -18,7 +18,7 @@ public interface IMoGoWarnPolylineManager extends IProvider {
* @param context
* @param info
*/
void drawaWarnPolyline(Context context, DrawLineInfo info);
void drawWarnPolyline(Context context, DrawLineInfo info);
/**
* 移除连接线

View File

@@ -102,7 +102,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
info.setHeading(latLng.getBearing());
info.setStartLocation(startLatlng);
info.setEndLocation(endLatlng);
V2XServiceManager.getMoGoWarnPolylineManager().drawaWarnPolyline(getContext(), info);
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info);
}
} else {
Log.e(V2XConst.LOG_NAME_WARN, "mCloundWarningInfo == null");

View File

@@ -28,7 +28,7 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
@Override
public void drawaWarnPolyline(Context context, DrawLineInfo info) {
public void drawWarnPolyline(Context context, DrawLineInfo info) {
try {
if (mMogoPolyline != null) {
mMogoPolyline.remove();

View File

@@ -72,7 +72,7 @@ public class V2XWarningMarker implements IV2XMarker {
MogoLatLng endLatLng = new MogoLatLng(mMarkerEntity.getCollisionLat(), mMarkerEntity.getCollisionLon());
drawLineInfo.setStartLocation(slatLng);
drawLineInfo.setEndLocation(endLatLng);
V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(mContext, drawLineInfo);
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(mContext, drawLineInfo);
}
public void smooth() {