This commit is contained in:
lixiaopeng
2021-04-07 19:16:32 +08:00
parent 2f80a3ca83
commit e3450f20cf
7 changed files with 78 additions and 109 deletions

View File

@@ -26,9 +26,7 @@ import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_
public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedListener {
private static final String TAG = "V2XWarnDataDrawer";
private static volatile V2XWarnDataDrawer sInstance;
private boolean mChangeCarModeStatus;
private V2XWarnDataDrawer() {
@@ -80,21 +78,18 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
WorkThreadHandler.getInstance().postDelayed(() -> {
IMogoMarker marker = drawMarker(markerShowEntity);
Log.d("liyz", "renderWarnData marker != null ");
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed( () -> {
marker.remove();
}, 8000 );
}, 0);
IMogoMarker marker = drawMarker(markerShowEntity);
Log.d("liyz", "renderWarnData marker != null ");
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), 5000);
//移动完成以后3s后消失
UiThreadHandler.postDelayed(() -> {
marker.remove();
}, 8000);
}
public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity) {
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
@@ -104,7 +99,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
options.icon3DRes(getModelRes(2)); //TODO
// options.anchorColor("#FF4040");
options.anchorColor("#FF3036"); //红色
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);
marker.setToTop();