add draw line and show

This commit is contained in:
lixiaopeng
2021-04-25 17:58:14 +08:00
parent b87d8f38ff
commit 707fa23eef
13 changed files with 177 additions and 175 deletions

View File

@@ -41,7 +41,6 @@ import static com.mogo.module.v2x.V2XServiceManager.getContext;
*/
public class V2XWaringManager {
List<MogoLatLng> lonLats = new ArrayList<>();
private Context mContext;
private static V2XWaringManager mV2XWaringManager;
@@ -111,7 +110,6 @@ public class V2XWaringManager {
} catch (Exception e) {
e.printStackTrace();
}
}
/**
@@ -151,43 +149,6 @@ public class V2XWaringManager {
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
//测试数据
testData(adasResult);
// adas 每隔一秒传递的他车或行人数据,避免重复。
// V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
// // 处理他车车身变色,这个可以使用 TODO
// AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
//
// // adas自车定位显示红色碰撞预警图以及解除碰撞
// double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
// double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
// //需要把自车的经纬度前移到车头然后打点红色的marker
//
// } );
}
/**
* 添加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;
}