From 326076a4088ca331d818cae5996cc9bc197c1df8 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 25 Jul 2024 14:56:20 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0][Fix]=E8=A7=A3=E5=86=B3=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=E6=98=BE=E7=A4=BAMarker=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E6=A0=B7=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/view/TravelRealityView.kt | 45 +++---------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt index ae49cbf778..2c9f3a37a2 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt @@ -809,42 +809,7 @@ class TravelRealityView @JvmOverloads constructor( it.forEach { roadCamera -> roadCamera.ip?.let { ip -> - if (roadCamera.imageUrl.isNullOrEmpty()) { - var view: EventVideoView - if (ipPointEntityMap[ip] != null) { - // 一个ip可能对应多个卡片缩略图 - ipPointEntityMap[ip]!!.forEach { videoMarkerEntity -> - // 计算卡片四个顶点的高德地图经纬度 - vertexList.addAll( - getRectVertex( - videoMarkerEntity.orientation, - videoMarkerEntity.latLng - ) - ) - markerOption = MarkerOptions() - markerOption.zIndex(0.9f) - markerOption.position(videoMarkerEntity.latLng) - view = EventVideoView( - context, - title = videoMarkerEntity.title, - orientation = videoMarkerEntity.orientation - ) - pair = - travelNetWorkModel.calculateAnchor(videoMarkerEntity.orientation) - Log.d( - TAG, - "绘制时位置为:${videoMarkerEntity.latLng},标题为:${videoMarkerEntity.title},方向为:${videoMarkerEntity.orientation},锚点为:${pair}" - ) - markerOption.anchor(pair.first, pair.second) - view.setPlaceHolder() - markerOption.icon(BitmapDescriptorFactory.fromView(view)) - liveOptionsList.add(markerOption) - } - } else { - Log.d(TAG, "缓存中未查到对应ip!") - return@let - } - } else { + if (!roadCamera.imageUrl.isNullOrEmpty()) { if (ipPointEntityMap[ip] != null) { ipPointEntityMap[ip]!!.forEach { videoMarkerEntity -> // 计算卡片四个顶点的高德地图经纬度 @@ -857,7 +822,6 @@ class TravelRealityView @JvmOverloads constructor( // 需要下载缩略图 markerOption = MarkerOptions() markerOption.zIndex(0.9f) - markerOption.icon(null) markerOption.position(videoMarkerEntity.latLng) pair = travelNetWorkModel.calculateAnchor( videoMarkerEntity.orientation @@ -1601,7 +1565,11 @@ class TravelRealityView @JvmOverloads constructor( } liveMarkerList.clear() mAMap?.let { - liveMarkerList.addAll(it.addMarkers(liveOptionList, false)) + liveOptionList.forEach { options -> + liveMarkerList.add(it.addMarker(options).also { marker -> + marker.isVisible = false + }) + } } } @@ -1619,6 +1587,7 @@ class TravelRealityView @JvmOverloads constructor( options.forEach { if (it.position == liveMarker.position) { liveMarker.setIcon(it.icon) + liveMarker.isVisible = true } } }