探路监听click道路事件->V2X

This commit is contained in:
liujing
2020-10-21 15:31:41 +08:00
parent 3a47ef4a11
commit 00a9ec4fce
4 changed files with 115 additions and 42 deletions

View File

@@ -370,47 +370,47 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
});
//监听marker点击
mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
@Override
public boolean onMarkerClicked(IMogoMarker marker) {
//点击的marker的具体数据
MarkerExploreWay exploreWay = extractFromMarker(marker);
V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity();
roadEventEntity.setNoveltyInfo(exploreWay);
roadEventEntity.setPoiType(exploreWay.getPoiType());
roadEventEntity.setExpireTime(20000);
//地理位置
MarkerLocation location = exploreWay.getLocation();
roadEventEntity.setLocation(location);
V2XMessageEntity v2XMessageEntity = new V2XMessageEntity();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XMessageEntity.setShowState(true);
v2XMessageEntity.setOnlyShow(true);
v2XMessageEntity.setNeedAddLine(false);
v2XMessageEntity.setContent(roadEventEntity);
//更新数据
if (markerExploreWayList != null) {
markerExploreWayList.clear();
} else {
markerExploreWayList = new ArrayList<>();
}
markerExploreWayList.add(exploreWay);
Intent intent = new Intent(Const.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(Const.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
//埋点
Map<String, Object> properties = new HashMap<>();
properties.put("type", "2");
mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties);
return false;
}
});
// mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
// @Override
// public boolean onMarkerClicked(IMogoMarker marker) {
//
// //点击的marker的具体数据
// MarkerExploreWay exploreWay = extractFromMarker(marker);
// V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity();
// roadEventEntity.setNoveltyInfo(exploreWay);
// roadEventEntity.setPoiType(exploreWay.getPoiType());
// roadEventEntity.setExpireTime(20000);
// //地理位置
// MarkerLocation location = exploreWay.getLocation();
// roadEventEntity.setLocation(location);
//
// V2XMessageEntity v2XMessageEntity = new V2XMessageEntity();
// v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
// v2XMessageEntity.setShowState(true);
// v2XMessageEntity.setOnlyShow(true);
// v2XMessageEntity.setNeedAddLine(false);
//
// v2XMessageEntity.setContent(roadEventEntity);
// //更新数据
// if (markerExploreWayList != null) {
// markerExploreWayList.clear();
// } else {
// markerExploreWayList = new ArrayList<>();
// }
// markerExploreWayList.add(exploreWay);
//
// Intent intent = new Intent(Const.BROADCAST_SCENE_HANDLER_ACTION);
// intent.putExtra(Const.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
// LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
//
// //埋点
// Map<String, Object> properties = new HashMap<>();
// properties.put("type", "2");
// mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties);
//
// return false;
// }
// });
}
private CountDownTimer mHideWindowTimer;