Merge branch 'qa_yingyan_custom' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into qa_yingyan_custom

This commit is contained in:
zhongchao
2021-04-26 15:08:13 +08:00
6 changed files with 51 additions and 34 deletions

View File

@@ -94,7 +94,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
IMogoMarker marker = drawMarker(markerShowEntity);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
//识别物
marker.addDynamicAnchorPosition(new MogoLatLng(
@@ -112,14 +112,31 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
}
//根据识别物类型 (行人0/自行车1/摩托车2/小汽车3/公交车4)获取3D模型(对应查看getModelRes)
private int modeResType(int dataType) {
switch (dataType) {
case 0:
return 1;
case 1:
return 2;
case 2:
return 4;
case 3:
return 3;
case 4:
return 6;
}
return 1;
}
public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity) {
public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity, int modeResType) {
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(1)); //TODO
options.icon3DRes(getModelRes(modeResType)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);