预警数据渲染前清除其他类型
This commit is contained in:
@@ -19,7 +19,7 @@ class DataTypes {
|
||||
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
|
||||
|
||||
/**
|
||||
* 云端下发警告数据
|
||||
* 云端下发识别目标物警告数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_WARN_DATA = "TYPE_MARKER_CLOUD_WARN_DATA";
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
private static final String TAG = "V2XWarnDataDrawer";
|
||||
private static volatile V2XWarnDataDrawer sInstance;
|
||||
private boolean mChangeCarModeStatus;
|
||||
private List<IMogoMarker> stopLineMarker = new ArrayList();
|
||||
|
||||
private V2XWarnDataDrawer() {
|
||||
super();
|
||||
@@ -169,11 +168,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
* @param data
|
||||
*/
|
||||
public void renderStopLineData(V2XWarningEntity data) {
|
||||
if (stopLineMarker.size() > 0) {
|
||||
for (int i = 0; i < stopLineMarker.size(); i++) {
|
||||
stopLineMarker.get(i).remove();
|
||||
}
|
||||
}
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(data.getLat());
|
||||
location.setLon(data.getLon());
|
||||
@@ -191,15 +185,18 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止线绘制
|
||||
*/
|
||||
public IMogoMarker drawStopLineMarker(MarkerShowEntity markerShowEntity) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(9)); //TODO
|
||||
options.icon3DRes(getModelRes(9));
|
||||
|
||||
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
||||
options.anchorColor("#FB3C3CFF");
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
|
||||
@@ -31,6 +31,8 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
@@ -84,13 +86,14 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getType(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
|
||||
isSelfLineClear = false;
|
||||
isFirstLocation = false;
|
||||
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
|
||||
if (cloundWarningInfo.getDirection() == 1) { //前方 TODO
|
||||
middleLocationInStopLine = getMiddleLocationInStopLine();
|
||||
MogoLatLng warningLocation = Trigonometric.getNewLocation(middleLocationInStopLine, 50, cloundWarningInfo.getAngle());
|
||||
//停止线前方画线
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawRedWarningLineFrontOfStopLine(cloundWarningInfo, middleLocationInStopLine, warningLocation);
|
||||
@@ -112,6 +115,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_WARN_DATA);
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//车辆静止的时候
|
||||
@@ -135,6 +139,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
private void handleStopLine() {
|
||||
try {
|
||||
if (mCloundWarningInfo != null) {
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
|
||||
for (int i = 0; i < fillPoints.size(); i++) {
|
||||
V2XWarningEntity entity = new V2XWarningEntity();
|
||||
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
|
||||
|
||||
Reference in New Issue
Block a user