Merge remote-tracking branch 'origin/dev_merge_shunyi_vr_map' into dev_merge_shunyi_vr_map
# Conflicts: # modules/mogo-module-service/src/main/java/com/mogo/module/service/location/MogoRTKLocation.java
This commit is contained in:
@@ -142,8 +142,10 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
webSocketData.setSn(Utils.getSn());
|
||||
webSocketData.setData(GsonUtil.jsonFromObject(body));
|
||||
MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
|
||||
if (lastKnown != null) {
|
||||
if (lastKnown != null&&!lastKnown.getCityCode().isEmpty()) {
|
||||
webSocketData.setCityCode(lastKnown.getCityCode());
|
||||
}else{
|
||||
webSocketData.setCityCode(null);
|
||||
}
|
||||
String msg = GsonUtil.jsonFromObject(webSocketData);
|
||||
Logger.d(TAG,"sendMsg : " + msg);
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
@@ -53,27 +53,45 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
if (mCloudRoadData != null) {
|
||||
CameraLiveManager.getInstance().init(mCloudRoadData);
|
||||
} else {
|
||||
Logger.e(TAG, " mCloudRoadData == null ");
|
||||
Logger.e(TAG, " onMarkerClicked mCloudRoadData == null ");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void release() {
|
||||
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(mContext).unregisterOnWebSocketMessageListener(this);
|
||||
mCloudRoadData = null;
|
||||
}
|
||||
|
||||
public void enterVrMode() {
|
||||
Logger.d(TAG, "enterVrMode===");
|
||||
Logger.d(TAG, "进入vr模式===");
|
||||
isVrMode = true;
|
||||
|
||||
//test
|
||||
// CloudRoadData cloudRoadData = new CloudRoadData();
|
||||
// cloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
|
||||
// //shunyi
|
||||
// cloudRoadData.setLat(40.200583);
|
||||
// cloudRoadData.setLon(116.738538);
|
||||
// addVrCameraMarker(cloudRoadData);
|
||||
}
|
||||
|
||||
|
||||
public void exitVrMode() {
|
||||
Logger.d(TAG, "退出vr模式===");
|
||||
isVrMode = false;
|
||||
|
||||
//test
|
||||
// CloudRoadData mCloudRoadData = new CloudRoadData();
|
||||
// mCloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
|
||||
// //shunyi
|
||||
// mCloudRoadData.setLat(40.200583);
|
||||
// mCloudRoadData.setLon(116.738538);
|
||||
// addNormalCameraMarker(mCloudRoadData);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +101,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addVrCameraMarker(CloudRoadData roadData) {
|
||||
Logger.d(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon());
|
||||
Log.d(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon());
|
||||
removeCameraMarker();
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(roadData)
|
||||
@@ -108,7 +126,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addNormalCameraMarker(CloudRoadData roadData) {
|
||||
Logger.d(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon());
|
||||
Log.d(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon());
|
||||
removeCameraMarker();
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(roadData)
|
||||
@@ -141,52 +159,60 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
return MogoSnapshotSetData.class;
|
||||
}
|
||||
|
||||
private volatile boolean isLoadVr;
|
||||
private volatile boolean isLoadNormal;
|
||||
private volatile boolean isLoadVr = false;
|
||||
private volatile boolean isLoadNormal = false;
|
||||
private volatile String mCurrentUuid;
|
||||
|
||||
private String mCurretnUuid;
|
||||
|
||||
/**
|
||||
* @param obj
|
||||
* @param obj TODO
|
||||
*/
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData obj) {
|
||||
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
|
||||
if (obj != null) {
|
||||
mCloudRoadData = obj.getCamera();
|
||||
|
||||
if (mCloudRoadData != null) {
|
||||
Log.e(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl() + "--- isVrMode = " + isVrMode + ">>>>mCurretnUuid = " + mCurretnUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid());
|
||||
if (mCurretnUuid != null && mCurretnUuid.equals(mCloudRoadData.getUuid())) {
|
||||
Log.e(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl() + "--- isVrMode = " + isVrMode + ">>>>mCurrentUuid = " + mCurrentUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid());
|
||||
if (mCurrentUuid != null && mCurrentUuid.equals(mCloudRoadData.getUuid())) {
|
||||
Log.d(TAG, "isLoadVr = " + isLoadVr + "....isLoadNormal = " + isLoadNormal);
|
||||
if (isVrMode) {
|
||||
if (!isLoadVr) {
|
||||
addVrCameraMarker(mCloudRoadData);
|
||||
isLoadVr = true;
|
||||
isLoadNormal = false;
|
||||
Log.d(TAG, "addVrCameraMarker1 ------------1-------- ");
|
||||
addVrCameraMarker(mCloudRoadData);
|
||||
} else {
|
||||
Log.e(TAG, "isVrMode not need add marker");
|
||||
}
|
||||
} else {
|
||||
if (!isLoadNormal) {
|
||||
addNormalCameraMarker(mCloudRoadData);
|
||||
isLoadNormal = true;
|
||||
isLoadVr = false;
|
||||
Log.d(TAG, "addNormalCameraMarker1------------2-------- ");
|
||||
addNormalCameraMarker(mCloudRoadData);
|
||||
} else {
|
||||
Log.e(TAG, "isNormalMode not need add marker");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isVrMode) {
|
||||
mCurrentUuid = mCloudRoadData.getUuid();
|
||||
Log.e(TAG, "mCurrentUuid == null " + "-----isVrMode = " + isVrMode);
|
||||
if (isVrMode) { //TODO
|
||||
Log.d(TAG, "addVrCameraMarker1 ------------11111-------- ");
|
||||
addVrCameraMarker(mCloudRoadData);
|
||||
} else {
|
||||
Log.d(TAG, "addNormalCameraMarker1 ------------22222-------- ");
|
||||
addNormalCameraMarker(mCloudRoadData);
|
||||
}
|
||||
mCurretnUuid = mCloudRoadData.getUuid();
|
||||
}
|
||||
} else {
|
||||
//删除marker
|
||||
removeCameraMarker();
|
||||
|
||||
// Log.e(TAG, "onMsgReceived mCloudRoadData == null ");
|
||||
// UiThreadHandler.postDelayed(() -> {
|
||||
//
|
||||
// }, 1_000);
|
||||
Log.e(TAG, "onMsgReceived mCloudRoadData == null ");
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
removeCameraMarker();
|
||||
}, 2_000);
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "onMsgReceived obj == null ");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.main;
|
||||
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
@@ -554,6 +555,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
mAlarmInfoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mAlarmInfoMarker.getMogoMarkerOptions()));
|
||||
mAlarmInfoMarker.showInfoWindow();
|
||||
} else {
|
||||
IMogoMarkerManager i = V2XServiceManager.getMarkerManager();
|
||||
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
}
|
||||
// 当前Marker设置为最上面
|
||||
|
||||
@@ -4,12 +4,19 @@ import android.os.Handler;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
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.WorkThreadHandler;
|
||||
@@ -19,6 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
import static com.mogo.module.v2x.V2XConst.V2X_EVENT_ALARM_POI;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -46,6 +54,14 @@ public class V2XIllegalParkMarker implements IV2XMarker<List<MarkerExploreWay>>
|
||||
if (entityList != null) {
|
||||
for (int i = 0; i < entityList.size(); i++) {
|
||||
MarkerExploreWay markerExploreWay = entityList.get(i);
|
||||
|
||||
// 道路事件,或者水波纹扩散效果
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.object(markerExploreWay)
|
||||
.latitude(markerExploreWay.getLocation().getLat())
|
||||
.longitude(markerExploreWay.getLocation().getLon());
|
||||
optionsRipple.anchor(0.5f, 0.5f);
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj(markerExploreWay);
|
||||
markerShowEntity.setChecked(false);
|
||||
@@ -54,7 +70,14 @@ public class V2XIllegalParkMarker implements IV2XMarker<List<MarkerExploreWay>>
|
||||
markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY);
|
||||
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
IMogoMarker mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity);
|
||||
IMogoMarker mogoMarker;
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, null);
|
||||
mogoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions()));
|
||||
mogoMarker.showInfoWindow();
|
||||
} else {
|
||||
mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity);
|
||||
}
|
||||
// 点击监听,天际弹窗展示详情
|
||||
if (mogoMarker != null) {
|
||||
mogoMarker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
"location":{
|
||||
"address":"北三环麻家什字",
|
||||
"angle":0,
|
||||
"lat":39.968598,
|
||||
"lon":116.411121
|
||||
"lat":39.969057,
|
||||
"lon":116.417831
|
||||
},
|
||||
"generateTime":0,
|
||||
"distance":0,
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
"zoom": true,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat":39.969088,
|
||||
"lon":116.41808
|
||||
"lat":39.968738,
|
||||
"lon":116.411288
|
||||
},
|
||||
"lat":39.969088,
|
||||
"lon":116.41808,
|
||||
"lat":39.968738,
|
||||
"lon":116.411288,
|
||||
"userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png",
|
||||
"msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg"
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
"location":{
|
||||
"address":"北三环环球贸易中心",
|
||||
"angle":270,
|
||||
"lat":39.969088,
|
||||
"lon":116.41808
|
||||
"lat":39.969057,
|
||||
"lon":116.417831
|
||||
},
|
||||
"noveltyInfo":{
|
||||
"addr":"北三环环球贸易中心",
|
||||
@@ -27,8 +27,8 @@
|
||||
"location":{
|
||||
"address":"北三环环球贸易中心",
|
||||
"angle":270,
|
||||
"lat":39.969088,
|
||||
"lon":116.41808
|
||||
"lat":39.969057,
|
||||
"lon":116.417831
|
||||
},
|
||||
"poiType":"10003",
|
||||
"type":"CARD_TYPE_ROAD_CONDITION",
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"coordinates":[
|
||||
"coordinates": [
|
||||
{
|
||||
"createTime":1593678359872,
|
||||
"distance":1100,
|
||||
"lat":39.969088,
|
||||
"lon":116.41808,
|
||||
"sn":"ZD801B1932L00041",
|
||||
"targetId":20007,
|
||||
"targetName":"故障车",
|
||||
"userInfo":{
|
||||
"age":33,
|
||||
"displayName":"小叮当",
|
||||
"headImgUrl":"http://img.zhidaohulian.com/fileServer/api/qa/user_info/1243669495923/7c476a0515aa51ae355d10d7f21c898e.jpg",
|
||||
"sex":1,
|
||||
"sn":"ZD801B1932L00041",
|
||||
"userId":1243669495923
|
||||
"createTime": 1593678359872,
|
||||
"distance": 1100,
|
||||
"lat":39.969057,
|
||||
"lon":116.417831,
|
||||
"sn": "ZD801B1932L00041",
|
||||
"targetId": 20007,
|
||||
"targetName": "故障车",
|
||||
"userInfo": {
|
||||
"age": 33,
|
||||
"displayName": "小叮当",
|
||||
"headImgUrl": "http://img.zhidaohulian.com/fileServer/api/qa/user_info/1243669495923/7c476a0515aa51ae355d10d7f21c898e.jpg",
|
||||
"sex": 1,
|
||||
"sn": "ZD801B1932L00041",
|
||||
"userId": 1243669495923
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user