opot
This commit is contained in:
@@ -4,16 +4,27 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionView;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionWindow3DAdapter;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.module.common.view.MarkerBaseFloor;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.listener.V2XWarnMessageListener;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -130,44 +141,41 @@ public class V2XWaringManager {
|
||||
//测试数据
|
||||
testData();
|
||||
|
||||
// 绘制连接线
|
||||
// DrawLineInfo info1 = new DrawLineInfo();
|
||||
// MogoLatLng startLatlng1 = new MogoLatLng(39.968919,116.407642);
|
||||
// MogoLatLng endLatlng1 = new MogoLatLng(40.010906,116.423821);
|
||||
// info1.setHeading(10);
|
||||
// info1.setStartLocation(startLatlng1);
|
||||
// info1.setEndLocation(endLatlng1);
|
||||
|
||||
// adas 每隔一秒传递的他车或行人数据,避免重复
|
||||
// adas 每隔一秒传递的他车或行人数据,避免重复。
|
||||
// V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
|
||||
// // 绘制近景识别到的车辆,行人和二轮车
|
||||
// // 处理他车车身变色,这个可以使用 TODO
|
||||
// AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
//
|
||||
// //清理
|
||||
// V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
//
|
||||
// // 绘制连接线
|
||||
// DrawLineInfo info = new DrawLineInfo();
|
||||
// MogoLatLng startLatlng = new MogoLatLng(39.969247,116.407299);
|
||||
// MogoLatLng endLatlng = new MogoLatLng(39.971089,116.407384);
|
||||
// info.setStartLocation(startLatlng);
|
||||
// info.setEndLocation(endLatlng);
|
||||
// V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(mContext, info);
|
||||
//
|
||||
// //更新数据
|
||||
// for (ADASRecognizedResult result : resultList) {
|
||||
// MogoLatLng latLng = new MogoLatLng(result.lat, result.lon);
|
||||
// lonLats.add(latLng);
|
||||
// }
|
||||
// IMogoPolyline mMogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
// mMogoPolyline.setPoints(lonLats);
|
||||
// // adas自车定位,显示红色碰撞预警图,以及解除碰撞
|
||||
// double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
// double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
// //需要把自车的经纬度前移到车头,然后打点红色的marker
|
||||
//
|
||||
// } );
|
||||
//
|
||||
//adas自车定位
|
||||
// MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient().getLastKnowLocation()
|
||||
// double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
// double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加2d的碰撞 marker
|
||||
* @param markerShowEntity
|
||||
* @return
|
||||
*/
|
||||
private IMogoMarker drawMarker2dResource(MarkerShowEntity markerShowEntity) {
|
||||
MogoLatLng mogoLatLng = new MogoLatLng(markerShowEntity.getMarkerLocation().getLat(), markerShowEntity.getMarkerLocation().getLon());
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.latitude(newLocation.getLat())
|
||||
.longitude(newLocation.getLon())
|
||||
.anchor(1.0f, 1.0f)
|
||||
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
optionsRipple
|
||||
.icon(ViewUtils.fromView(new EmptyMarkerView(mContext)));
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), optionsRipple);
|
||||
|
||||
marker.setInfoWindowAdapter(new AheadCollisionWindow3DAdapter(mContext));
|
||||
marker.showInfoWindow();
|
||||
return marker;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user