Merge remote-tracking branch 'origin/demo/shunyi_vr_map' into demo/shunyi_vr_map
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 985 B |
@@ -1054,8 +1054,8 @@
|
||||
<dimen name="sp_48">48px</dimen>
|
||||
<dimen name="module_common_shadow_width">-10px</dimen>
|
||||
<dimen name="module_common_shadow_width_pos">10px</dimen>
|
||||
<dimen name="heart_ratingbar_width">40px</dimen>
|
||||
<dimen name="heart_ratingbar_height">43px</dimen>
|
||||
<dimen name="heart_ratingbar_width">33px</dimen>
|
||||
<dimen name="heart_ratingbar_height">30px</dimen>
|
||||
<dimen name="v2x_panel_loading_top">300px</dimen>
|
||||
<dimen name="v2x_share_btn_width">281px</dimen>
|
||||
<dimen name="v2x_share_btn_height">90px</dimen>
|
||||
|
||||
@@ -32,11 +32,8 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
private final String TAG = "V2XPushVREventMarker";
|
||||
|
||||
private static IMogoPolyline mMogoPolyline;
|
||||
|
||||
// 上次的道路事件的预警Marker
|
||||
private static IMogoMarker mAlarmInfoMarker;
|
||||
|
||||
|
||||
@Override
|
||||
public void drawPOI(V2XPushMessageEntity entity) {
|
||||
Logger.w(V2XConst.MODULE_NAME + "_" + TAG, "drawPOI 绘制VR Marker");
|
||||
@@ -49,42 +46,46 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
}
|
||||
drawableEventMarker(entity);
|
||||
|
||||
// 道路事件,或者水波纹扩散效果
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.object(entity)
|
||||
.latitude(entity.getLat())
|
||||
.longitude(entity.getLon());
|
||||
optionsRipple.anchor(0.5f, 0.5f);
|
||||
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XVRRoadEventViewPng(entity));
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
moveTrack(entity);
|
||||
// drawablePloyLine(entity);
|
||||
// 绘制引导线
|
||||
drawablePloyLine(entity);
|
||||
drawableRecommendPolyline(entity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
平滑移动
|
||||
* */
|
||||
void moveTrack(V2XPushMessageEntity entity) {
|
||||
List<MogoLatLng> points = new ArrayList();
|
||||
List<double[]> polylines = entity.getMoveTrack();
|
||||
for (int i = 0; i < polylines.size(); i++) {
|
||||
try {
|
||||
double[] latlonList = polylines.get(i);
|
||||
MogoLatLng latLng = new MogoLatLng(latlonList[1], latlonList[0]);
|
||||
points.add(latLng);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* 绘制事件点
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawableEventMarker(V2XPushMessageEntity entity) {
|
||||
// 道路事件
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.object(entity)
|
||||
.latitude(entity.getLat())
|
||||
.longitude(entity.getLon());
|
||||
optionsRipple.anchor(0.5f, 0.5f);
|
||||
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XVRRoadEventViewPng(entity));
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
|
||||
List<MogoLatLng> points = new ArrayList<>();
|
||||
|
||||
for (double[] doubles : entity.getMoveTrack()) {
|
||||
points.add(new MogoLatLng(doubles[1], doubles[0]));
|
||||
}
|
||||
Log.d("平滑移动经纬度=====",points.toString());
|
||||
mAlarmInfoMarker.startSmooth(points, 1);
|
||||
|
||||
mAlarmInfoMarker.startSmooth(points, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制引导线
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawablePloyLine(V2XPushMessageEntity entity) {
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
@@ -96,7 +97,7 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
colors.add(0xFFFA8C34);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(15).useGradient(true).colorValues(colors);
|
||||
options.width(15).useGradient(true).color(0xFFFA8C34);
|
||||
|
||||
for (double[] doubles : entity.getPolyline()) {
|
||||
options.add(doubles[0], doubles[1]);
|
||||
@@ -106,6 +107,32 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制推荐引导线
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawableRecommendPolyline(V2XPushMessageEntity entity) {
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0xFFF95959);
|
||||
colors.add(0xFF942B48);
|
||||
colors.add(0xFFCB253A);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(15).useGradient(true).color(0xFFCB253A);
|
||||
|
||||
for (double[] doubles : entity.getRecommendPolyline()) {
|
||||
options.add(doubles[0], doubles[1]);
|
||||
}
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
|
||||
@@ -35,7 +35,7 @@ public class V2XPushVREventScenario
|
||||
synchronized (V2XPushVREventScenario.class) {
|
||||
if (mV2XPushEventScenario == null) {
|
||||
mV2XPushEventScenario = new V2XPushVREventScenario();
|
||||
mV2XPushEventScenario.setV2XMarker(new V2XPushVRNiXiangEventMarker());
|
||||
mV2XPushEventScenario.setV2XMarker(new V2XPushVREventMarker());
|
||||
mV2XPushEventScenario.setV2XWindow(new V2XPushVREventWindow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
package com.mogo.module.v2x.scenario.scene.pushVR;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.marker.V2XMarkerAdapter;
|
||||
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;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.V2X_EVENT_ALARM_POI;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/5/15 5:37 PM
|
||||
* desc : 逆向来车
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XPushVRNiXiangEventMarker implements IV2XMarker<V2XPushMessageEntity> {
|
||||
private final String TAG = "V2XPushVREventMarker";
|
||||
|
||||
|
||||
private static IMogoPolyline mMogoPolyline;
|
||||
private static IMogoMarker mAlarmInfoMarker;
|
||||
|
||||
@Override
|
||||
public void drawPOI(V2XPushMessageEntity entity) {
|
||||
Logger.w(V2XConst.MODULE_NAME + "_" + TAG, "drawPOI 绘制VR Marker");
|
||||
|
||||
try {
|
||||
// 清除道路事件
|
||||
V2XServiceManager
|
||||
.getMoGoV2XMarkerManager().clearALLPOI();
|
||||
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
}
|
||||
drawableEventMarker(entity);
|
||||
|
||||
// 绘制引导线
|
||||
drawablePloyLine(entity);
|
||||
drawableRecommendPolyline(entity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制事件点
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawableEventMarker(V2XPushMessageEntity entity) {
|
||||
// 道路事件
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.object(entity)
|
||||
.latitude(entity.getLat())
|
||||
.longitude(entity.getLon());
|
||||
optionsRipple.anchor(0.5f, 0.5f);
|
||||
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XVRRoadEventViewPng(entity));
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
|
||||
List<MogoLatLng> points = new ArrayList<>();
|
||||
|
||||
for (double[] doubles : entity.getMoveTrack()) {
|
||||
points.add(new MogoLatLng(doubles[1], doubles[0]));
|
||||
}
|
||||
|
||||
mAlarmInfoMarker.startSmooth(points, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制引导线
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawablePloyLine(V2XPushMessageEntity entity) {
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0xFFFA8C34);
|
||||
colors.add(0xFFBD6D36);
|
||||
colors.add(0xFFFA8C34);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(15).useGradient(true).color(0xFFFA8C34);
|
||||
|
||||
for (double[] doubles : entity.getPolyline()) {
|
||||
options.add(doubles[0], doubles[1]);
|
||||
}
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制推荐引导线
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
void drawableRecommendPolyline(V2XPushMessageEntity entity) {
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0xFFF95959);
|
||||
colors.add(0xFF942B48);
|
||||
colors.add(0xFFCB253A);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(15).useGradient(true).color(0xFFCB253A);
|
||||
|
||||
for (double[] doubles : entity.getRecommendPolyline()) {
|
||||
options.add(doubles[0], doubles[1]);
|
||||
}
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
MarkerUtils.resetMapZoom(16);
|
||||
// 移除线
|
||||
clearLine();
|
||||
// 移除事件POI
|
||||
clearAlarmPOI();
|
||||
// 绘制上次的数据
|
||||
V2XServiceManager.getMoGoV2XMarkerManager().drawableLastAllPOI();
|
||||
}
|
||||
|
||||
void clearAlarmPOI() {
|
||||
if (mAlarmInfoMarker != null) {
|
||||
mAlarmInfoMarker.remove();
|
||||
}
|
||||
}
|
||||
|
||||
public void clearLine() {
|
||||
if (mMogoPolyline != null) {
|
||||
mMogoPolyline.remove();
|
||||
mMogoPolyline = null;
|
||||
V2XServiceManager.getV2XStatusManager().setAlarmInfo(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 985 B |