平移
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.scene.warning;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -16,6 +17,9 @@ import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
@@ -40,23 +44,14 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
clearPOI();
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(com.mogo.module.service.R.raw.people);
|
||||
options.anchorColor("#FF4040");
|
||||
IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
IMogoMarker marker = drawMarker(markerShowEntity);
|
||||
//如果有预警碰撞点,识别物与预警碰撞点之间连线,并执行平移动画
|
||||
if (mMarkerEntity.getCollisionLat() > 0 && mMarkerEntity.getCollisionLon() != 0) {
|
||||
drawLine();
|
||||
smooth(marker);
|
||||
}
|
||||
}, 0);
|
||||
|
||||
//如果有预警碰撞点,识别物与预警碰撞点之间连线,并执行平移动画
|
||||
if (mMarkerEntity.getCollisionLat() > 0 && mMarkerEntity.getCollisionLon() != 0) {
|
||||
drawLine();
|
||||
smooth();
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -66,6 +61,20 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
|
||||
}
|
||||
|
||||
public IMogoMarker drawMarker(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(com.mogo.module.service.R.raw.people);
|
||||
options.anchorColor("#FF4040");
|
||||
IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
return marker;
|
||||
}
|
||||
|
||||
public void drawLine() {
|
||||
DrawLineInfo drawLineInfo = new DrawLineInfo();
|
||||
MogoLatLng slatLng = new MogoLatLng(mMarkerEntity.getLat(), mMarkerEntity.getLon());
|
||||
@@ -75,8 +84,9 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(mContext, drawLineInfo);
|
||||
}
|
||||
|
||||
public void smooth() {
|
||||
|
||||
public void smooth(IMogoMarker marker) {
|
||||
List<MogoLatLng> latLngs = new ArrayList<>();
|
||||
marker.startSmoothInMs(15000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user