Merge remote-tracking branch 'origin/demo/shunyi_vr_map' into demo/shunyi_vr_map
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.module.common.entity;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -29,8 +30,7 @@ public class V2XPushMessageEntity implements Serializable {
|
||||
private String videoChannel;
|
||||
private int expireTime;
|
||||
private long createTime;
|
||||
private double lat;
|
||||
private double lon;
|
||||
|
||||
private String sn;
|
||||
private String headImgUrl;
|
||||
private String msgImgUrl;
|
||||
@@ -43,6 +43,11 @@ public class V2XPushMessageEntity implements Serializable {
|
||||
private int sex;
|
||||
private long userId;
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
|
||||
private List<double[]> polyline;
|
||||
|
||||
public int getViewType() {
|
||||
return viewType;
|
||||
}
|
||||
@@ -266,6 +271,14 @@ public class V2XPushMessageEntity implements Serializable {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public List<double[]> getPolyline() {
|
||||
return polyline;
|
||||
}
|
||||
|
||||
public void setPolyline(List<double[]> polyline) {
|
||||
this.polyline = polyline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
|
||||
private View selfCar;
|
||||
|
||||
private boolean lightCenter = false;
|
||||
private boolean lightCenter = true;
|
||||
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
@@ -184,7 +184,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
tvTrafficLight.setText(surplusTime + "S");
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showMyLocation(selfCar);
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showMyLocation(inflateRoadInfo());
|
||||
if (isVrMode) {
|
||||
handler.sendEmptyMessageDelayed(MSG_REFRESH_CAR_STRATEGY, STRATEGY_DELAY);
|
||||
}
|
||||
@@ -326,4 +326,13 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
|
||||
}
|
||||
}
|
||||
|
||||
private View inflateRoadInfo(){
|
||||
View view = View.inflate(context, R.layout.module_ext_item_self_car, null);
|
||||
TextView _speed = view.findViewById(R.id.tvSelfSpeed);
|
||||
_speed.setText("" + currentSpeed);
|
||||
Logger.d(TAG, "showCurrentSpeed: " + currentSpeed);
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
@@ -17,7 +17,7 @@
|
||||
android:text="72"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_red"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvTrafficLight"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTrafficLight"/>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
android:text="26S"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_green"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/ivSelfCar"
|
||||
app:layout_constraintRight_toRightOf="@+id/ivSelfCar"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ivSelfCar"/>
|
||||
@@ -47,7 +47,7 @@
|
||||
android:text="160"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_white"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvTrafficLight"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTrafficLight"/>
|
||||
|
||||
|
||||
@@ -234,13 +234,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_ext_vr_mode_self_speed_margin_end"
|
||||
android:background="@drawable/module_ext_vr_mode_speed_red_bg"
|
||||
android:layout_marginBottom="@dimen/module_ext_vr_mode_self_speed_margin_bottom"
|
||||
android:gravity="center"
|
||||
android:text="72"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_red"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvTrafficLight"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTrafficLight"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
@@ -255,22 +258,23 @@
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvLimitSpeed"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvLimitSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvSelfSpeed"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvSelfSpeed"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLimitSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_ext_vr_mode_self_speed_margin_end"
|
||||
android:background="@drawable/module_ext_vr_mode_speed_white_bg"
|
||||
android:gravity="center"
|
||||
android:text="160"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_white"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvTrafficLight"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivUserHeadImg"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvSelfSpeed"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
|
||||
@@ -179,5 +179,6 @@
|
||||
|
||||
<dimen name="module_ext_vr_mode_traffic_light_text_size">32px</dimen>
|
||||
<dimen name="module_ext_vr_mode_self_speed_margin_end">15px</dimen>
|
||||
<dimen name="module_ext_vr_mode_self_speed_margin_bottom">100px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.mogo.module.v2x.scenario.scene.pushVR;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerExploreWayItem;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -22,42 +21,42 @@ import java.util.List;
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
private final String TAG = "V2XPushVREventMarker";
|
||||
|
||||
private static IMogoPolyline mMogoPolyline;
|
||||
|
||||
@Override
|
||||
public void drawPOI(V2XPushMessageEntity entity) {
|
||||
Logger.w(V2XConst.MODULE_NAME + "_" + TAG, "drawPOI 绘制VR Marker");
|
||||
|
||||
try {
|
||||
// 清除道路事件
|
||||
V2XServiceManager
|
||||
.getMoGoV2XMarkerManager().clearALLPOI();
|
||||
|
||||
// 位置信息
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLon(entity.getLon());
|
||||
markerLocation.setLat(entity.getLat());
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
}
|
||||
|
||||
// 进行数据转换,用于Marker展示
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS);
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
|
||||
MarkerExploreWay markerNoveltyInfo = new MarkerExploreWay();
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0xFFFA8C34);
|
||||
colors.add(0xFFBD6D36);
|
||||
colors.add(0xFFFA8C34);
|
||||
|
||||
List<MarkerExploreWayItem> items = new ArrayList<>();
|
||||
MarkerExploreWayItem exploreWayItem = new MarkerExploreWayItem();
|
||||
exploreWayItem.setThumbnail(entity.getMsgImgUrl());
|
||||
items.add(exploreWayItem);
|
||||
markerNoveltyInfo.setPoiType(V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS);
|
||||
markerNoveltyInfo.setItems(items);
|
||||
markerNoveltyInfo.setUploadType("1");
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(10).useGradient(true).colorValues(colors);
|
||||
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerNoveltyInfo);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
for (double[] doubles : entity.getPolyline()) {
|
||||
options.add(doubles[0],doubles[1]);
|
||||
}
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
|
||||
V2XServiceManager
|
||||
.getMoGoV2XMarkerManager()
|
||||
.drawableAlarmPOI(V2XServiceManager.getContext(),
|
||||
v2XRoadEventEntity,
|
||||
V2XMarkerClickListener.getInstance());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -69,10 +68,18 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
// 移除线
|
||||
V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
|
||||
clearLine();
|
||||
// 移除事件POI
|
||||
V2XServiceManager.getMoGoV2XMarkerManager().clearAlarmPOI();
|
||||
// 绘制上次的数据
|
||||
V2XServiceManager.getMoGoV2XMarkerManager().drawableLastAllPOI();
|
||||
}
|
||||
|
||||
public void clearLine() {
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
mMogoPolyline = null;
|
||||
V2XServiceManager.getV2XStatusManager().setAlarmInfo(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"sceneId": "200008",
|
||||
"alarmContent": "拥堵路线推荐",
|
||||
"expireTime": 30000,
|
||||
"expireTime": 20000,
|
||||
"sceneCategory": 0,
|
||||
"sceneDescription": "拥堵路线推荐",
|
||||
"sceneName": "拥堵路线推荐",
|
||||
@@ -14,9 +14,9 @@
|
||||
"zoomScale": 15,
|
||||
"userHead": "",
|
||||
"msgImgUrl": "",
|
||||
"lat": 40.195246,
|
||||
"lon": 116.728154,
|
||||
"polyLine": [
|
||||
"lat": 40.196512,
|
||||
"lon": 116.736461,
|
||||
"polyline": [
|
||||
[
|
||||
116.725092,
|
||||
40.195204
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"sceneId": "200008",
|
||||
"alarmContent": "拥堵路线推荐",
|
||||
"expireTime": 30000,
|
||||
"expireTime": 20000,
|
||||
"sceneCategory": 0,
|
||||
"sceneDescription": "拥堵路线推荐",
|
||||
"sceneName": "拥堵路线推荐",
|
||||
@@ -14,9 +14,9 @@
|
||||
"zoomScale": 15,
|
||||
"userHead": "",
|
||||
"msgImgUrl": "",
|
||||
"lat": 40.195246,
|
||||
"lon": 116.728154,
|
||||
"polyLine": [
|
||||
"lat": 40.196512,
|
||||
"lon": 116.736461,
|
||||
"polyline": [
|
||||
[
|
||||
116.725092,
|
||||
40.195204
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user