预警数据渲染前清除其他类型

This commit is contained in:
liujing
2021-04-22 11:49:07 +08:00
parent e7435e3cc6
commit b8c6cc6765
3 changed files with 12 additions and 10 deletions

View File

@@ -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";

View File

@@ -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();