|
|
|
|
@@ -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;
|
|
|
|
|
|
|
|
|
|
@@ -87,8 +91,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
|
|
|
|
|
|
|
|
|
MogoLatLng mogoLatLng = new MogoLatLng(data.getCollisionLat(), data.getCollisionLon());
|
|
|
|
|
//2D资源图片位置调整
|
|
|
|
|
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 8, 180);
|
|
|
|
|
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
|
|
|
|
|
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
|
|
|
|
|
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
|
|
|
|
|
|
|
|
|
|
IMogoMarker marker = drawMarker(markerShowEntity);
|
|
|
|
|
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
|
|
|
|
|
@@ -115,7 +119,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
|
|
|
|
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
|
|
|
|
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
|
|
|
|
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
|
|
|
|
options.icon3DRes(getModelRes(2)); //TODO
|
|
|
|
|
options.icon3DRes(getModelRes(1)); //TODO
|
|
|
|
|
|
|
|
|
|
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
|
|
|
|
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
|
|
|
|
@@ -125,18 +129,17 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
|
|
|
|
return marker;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void drawerMarkerWithLocation(MarkerShowEntity markerShowEntity, MogoLatLng location) {
|
|
|
|
|
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate) {
|
|
|
|
|
MogoMarkerOptions options = new MogoMarkerOptions()
|
|
|
|
|
.object(markerShowEntity)
|
|
|
|
|
.latitude(location.getLat())
|
|
|
|
|
.longitude(location.getLon());
|
|
|
|
|
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
|
|
|
|
options.icon3DRes(getModelRes(2)); //TODO
|
|
|
|
|
|
|
|
|
|
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
|
|
|
|
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
|
|
|
|
iMarkerView.setMarker(marker);
|
|
|
|
|
marker.setToTop();
|
|
|
|
|
.longitude(location.getLon())
|
|
|
|
|
.set3DMode(true)
|
|
|
|
|
.controlAngle(true)
|
|
|
|
|
.icon3DRes(getModelRes(type))
|
|
|
|
|
.anchorColor("#FB3C3CFF")
|
|
|
|
|
.flat(true);
|
|
|
|
|
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerType, options);
|
|
|
|
|
marker.setRotateAngle(rotate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -144,7 +147,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
|
|
|
|
* */
|
|
|
|
|
private IMogoMarker drawMarkerWith2Resource(MarkerShowEntity markerShowEntity) {
|
|
|
|
|
MogoLatLng mogoLatLng = new MogoLatLng(markerShowEntity.getMarkerLocation().getLat(), markerShowEntity.getMarkerLocation().getLon());
|
|
|
|
|
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 8, 180);
|
|
|
|
|
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
|
|
|
|
|
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
|
|
|
|
.latitude(newLocation.getLat())
|
|
|
|
|
.longitude(newLocation.getLon())
|
|
|
|
|
@@ -182,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(1)); //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();
|
|
|
|
|
|