停止线绘制避免重复,绘制前先清除
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -21,6 +22,9 @@ import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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;
|
||||
|
||||
@@ -33,6 +37,7 @@ 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();
|
||||
@@ -164,6 +169,11 @@ 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());
|
||||
|
||||
Reference in New Issue
Block a user