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