线绘制代码迁移

首次预警拿不到车的位置,因为未接入ADAS,等提测
This commit is contained in:
liujing
2021-05-11 17:15:13 +08:00
parent 5da8e0ad1d
commit 9ae5f05b1d
6 changed files with 91 additions and 95 deletions

View File

@@ -86,30 +86,14 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker bottomMarker = drawMarkerWith2Resource(markerShowEntity);
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
//2D资源图片位置调整
// MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
// MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
//识别物
marker.addDynamicAnchorPosition(new MogoLatLng(
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
//识别物下方的红色圆圈
bottomMarker.addDynamicAnchorPosition(new MogoLatLng(
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
// bottomMarker.addDynamicAnchorPosition(new MogoLatLng(
// data.getDirection() == 1 ? stopLineNew.lat : newLocation.getLat(),
// data.getDirection() == 1 ? stopLineNew.lon : newLocation.getLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
bottomMarker.remove();
}, 8000);
}