From 2e02cf6c0df2f15ffc4a7450174b66cb2b779cad Mon Sep 17 00:00:00 2001 From: lianglihui Date: Mon, 12 Dec 2022 17:30:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?2.13.0.1=20fix=20=E9=AB=98=E7=B2=BE?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=B4=A9=E6=BA=83=20=20version=20to=202.8.0.?= =?UTF-8?q?9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0b041116c8..e9147f7489 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.27 MOGO_TELEMATIC_VERSION=1.4.3.27 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.8.0.8 +MAP_SDK_VERSION=2.8.0.9 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7 From 09d23df9501f8a94a65fde99f7184f9424c78822 Mon Sep 17 00:00:00 2001 From: renwj Date: Mon, 12 Dec 2022 19:50:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[2.13.0]=E4=BF=AE=E6=AD=A3=E5=8D=81?= =?UTF-8?q?=E5=AD=97=E8=B7=AF=E5=8F=A3=E8=A7=86=E8=A7=92=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E6=81=A2=E5=A4=8D=E5=88=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=A7=86=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../call/map/CallerVisualAngleManager.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index c412fee003..3762bc0104 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.Lifecycle.Event.ON_DESTROY import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.LifecycleOwner import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.* @@ -24,6 +25,8 @@ import kotlinx.coroutines.internal.synchronized import java.util.* import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit.SECONDS +import java.util.concurrent.atomic.* +import kotlin.math.* /** * 高精地图视角管理类 @@ -59,6 +62,9 @@ object CallerVisualAngleManager { val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值, } + private val beginLocation = AtomicReference() + + private val listener = object : OnRoadListener { private var roadId = "" override fun onRoadIdInfo(roadId: String) { @@ -68,13 +74,24 @@ object CallerVisualAngleManager { hasCrossRoad = false changeVisualAngle(CrossRoad(false)) } + } else { + if (hasCrossRoad) { + val beginLoc = beginLocation.get() + val endLoc = CallerMapLocationListenerManager.getCurrentLocation() + if (beginLoc != null && endLoc != null && abs(beginLoc.bearing - endLoc.bearing) >= 170) { + hasCrossRoad = false + changeVisualAngle(CrossRoad(false)) + } + } } this.roadId = roadId } + override fun onStopLineInfo(info: StopLine) { if (!hasCrossRoad && info.distanceOfCarToStopLine <= 30.0) { hasCrossRoad = true + beginLocation.set(CallerMapLocationListenerManager.getCurrentLocation()) changeVisualAngle(CrossRoad(true)) } }