From cc927f89808ed8f848035d7b3fc1ed98d8ca5c2f Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Wed, 12 Aug 2020 15:02:18 +0800 Subject: [PATCH] add showbound --- .../mogo/module/v2x/V2XServiceManager.java | 1 - .../v2x/fragment/V2XEventPanelFragment.kt | 2 +- ...gment.java => V2XSurroundingFragment.java} | 71 +++++++++++++++++-- .../src/main/res/values-xhdpi/dimens.xml | 5 ++ .../src/main/res/values/dimens.xml | 4 ++ 5 files changed, 77 insertions(+), 6 deletions(-) rename modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/{SurroundingEventFragment.java => V2XSurroundingFragment.java} (78%) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java index 3dd852c6c7..9aac886249 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java @@ -55,7 +55,6 @@ public class V2XServiceManager { private static IMogoLocationClient mMogoLocationClient; private static IMogoGeoSearch mIMogoGeoSearch; private static IMogoSearchManager mIMogoSearchManager; - private static IMogoTopViewManager mMogoTopViewManager; private static IMogoStatusManager mMogoStatusManager; private static IMogoWindowManager mIMogoWindowManager; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt index 597d96cc7f..3542bee411 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt @@ -48,7 +48,7 @@ class V2XEventPanelFragment : MvpFragment implements SurroundingEventView, +public class V2XSurroundingFragment extends MvpFragment implements SurroundingEventView, View.OnClickListener, SurroundingItemClickListener { private static final String TAG = "SurroundingFragment"; private RecyclerView mRecyclerView; @@ -193,9 +196,6 @@ public class SurroundingEventFragment extends MvpFragment exploreWayList) { + Logger.e(TAG, "showBonndsRoadtion exploreWayList.size() = " + exploreWayList.size()); + Rect rect = new Rect( + (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left), + (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top), + (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right), + (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom)); + + moveNotFresh(); + //第一个参数:调用者,第二个参数:当前自车的位置,第三个参数:需要显示在范围内的点(不包含自车的位置) + //第四个参数:显示范围的UI边界,第五个参数:是否锁定自车位置(看业务需要) + V2XServiceManager.getMapUIController().showBounds(ServiceConst.CARD_TYPE_ROAD_CONDITION, null, getMogoList(exploreWayList), rect, false); + } + + private void moveNotFresh() { + V2XServiceManager.getMoGoStatusManager().setUserInteractionStatus(TAG, true, false); + } + + /** + * 构造经纬度列表 + * + * @return + */ + private List getMogoList(List markerExploreWayList) { + List list = new ArrayList<>(); + if (markerExploreWayList != null && markerExploreWayList.size() > 0) { + if (markerExploreWayList.size() < 6) { + for (int i = 0; i < markerExploreWayList.size(); i++) { + MarkerLocation location = markerExploreWayList.get(i).getLocation(); + if (location != null) { + MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon()); + list.add(mogoLatLng); + } else { + Logger.e(TAG, "getMogoList() < 6 location == null"); + } + } + } else { + for (int i = 0; i < 6; i++) { + MarkerLocation location = markerExploreWayList.get(i).getLocation(); + if (location != null) { + MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon()); + list.add(mogoLatLng); + } else { + Logger.e(TAG, "getMogoList() location == null"); + } + } + } + } else { + Logger.e(TAG, "getMogoList() markerExploreWay == null"); + } + return list; + } + + @Override public void onDestroy() { super.onDestroy(); diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index a534085c47..a7a1f0b66f 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -25,4 +25,9 @@ 80px 6px + 550px + 200px + 200px + 100px + diff --git a/modules/mogo-module-v2x/src/main/res/values/dimens.xml b/modules/mogo-module-v2x/src/main/res/values/dimens.xml index bd225eb0a4..12bbc42e11 100644 --- a/modules/mogo-module-v2x/src/main/res/values/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values/dimens.xml @@ -26,5 +26,9 @@ 40px 6px 16px + 550px + 200px + 200px + 100px