[6.3.0][V2N-视角] 优化V2N事件触发时的视角切换动效

This commit is contained in:
renwj
2024-03-12 15:48:53 +08:00
parent 318ddaf9e0
commit f23ebb0f35

View File

@@ -21,10 +21,11 @@ import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoad
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.zhidaoauto.map.data.road.StopLine
import com.zhidaoauto.map.sdk.open.MapAutoApi
import com.zhidaoauto.map.sdk.open.common.tools.MapTools
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
import java.util.*
import java.util.concurrent.Executors
import java.util.concurrent.atomic.*
@Route(path = MogoServicePaths.PATH_VISUAL_ANGLE)
@@ -146,7 +147,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
private var defaultDelayJob: Job? = null
private fun acquireScope(): CoroutineScope {
return CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher("change-visual-angle") + SupervisorJob())
return CoroutineScope(Executors.newSingleThreadExecutor().asCoroutineDispatcher() + SupervisorJob())
}
@Volatile
@@ -273,9 +274,16 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
if (!AppIdentityModeUtils.isTaxiPassenger(FunctionBuildConfig.appIdentityMode)) {
roadEventFlag = true
it.setLockMode(false)
scope.launch {
it.animateTo(0.0 ,0.0,1f, - target.target.poi_angle.toFloat(),11.5f,28f,3000,target.target.isGps)
}
/**
* var center = mapAutoView.getCurrentLonLatPoint()
* var target = LonLatPoint(112.57295762931203, 26.823537024568793)
* var angle = MapAutoApi.getAngle(center.longitude,center.latitude,target.longitude,target.latitude)
*/
val isGps = target.target.isGps
val car = if (isGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
val rotateAngle = MapAutoApi.getAngle(car.longitude, car.latitude, target.target.poi_lon, target.target.poi_lat)
Log.d(TAG, "angle->:$rotateAngle")
it.animateTo(0.0 ,0.0,1f, -rotateAngle,11.5f,28f,3000,target.target.isGps)
}
} else {
if (target.target is Default && previous != null && (previous.target is RoadEvent)) {