预警识别物下方红色圆圈位置调整

This commit is contained in:
liujing
2021-04-15 10:30:06 +08:00
parent 4aba759d52
commit 679e183859

View File

@@ -88,8 +88,9 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
IMogoMarker bottomMarker = drawMarkerWith2Resource(markerShowEntity);
//2D资源图片位置调整
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
//2D资源图片位置调整
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 8, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
IMogoMarker marker = drawMarker(markerShowEntity);
@@ -100,8 +101,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
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 : newLocation.getLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : newLocation.getLon()), (float) data.getHeading(), 5000);
data.getDirection() == 1 ? stopLineNew.lat : newLocation.getLat(),
data.getDirection() == 1 ? stopLineNew.lon : newLocation.getLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
@@ -127,7 +128,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
return marker;
}
public void drawerMarkerWithLocation(MarkerShowEntity markerShowEntity, MogoLatLng location){
public void drawerMarkerWithLocation(MarkerShowEntity markerShowEntity, MogoLatLng location) {
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
.latitude(location.getLat())
@@ -140,6 +141,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
iMarkerView.setMarker(marker);
marker.setToTop();
}
/*
* 2D资源绘制marker底部的红色圆圈
* */