2D圆圈位置调整

This commit is contained in:
liujing
2021-04-14 10:19:03 +08:00
parent 1697a866ed
commit e10d710d12

View File

@@ -87,6 +87,11 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker bottomMarker = drawMarkerWith2Resource(markerShowEntity);
//2D资源图片位置调整
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
IMogoMarker marker = drawMarker(markerShowEntity);
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
//识别物
@@ -95,8 +100,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 : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
data.getDirection() == 1 ? data.getStopLines().get(1).lat : newLocation.getLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : newLocation.getLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
@@ -127,7 +132,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
* */
private IMogoMarker drawMarkerWith2Resource(MarkerShowEntity markerShowEntity) {
MogoLatLng mogoLatLng = new MogoLatLng(markerShowEntity.getMarkerLocation().getLat(), markerShowEntity.getMarkerLocation().getLon());
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 80, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
.latitude(newLocation.getLat())
.longitude(newLocation.getLon())