[6.2.0][视角切换] 视角切换添加获取或设置默认视角接口
This commit is contained in:
@@ -1,68 +1,16 @@
|
||||
package com.mogo.eagle.core.function.api.map.angle
|
||||
|
||||
import com.mogo.map.uicontroller.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
private interface IAttach {
|
||||
interface IAttach {
|
||||
val angle: VisualAngleMode
|
||||
val priority: Int
|
||||
val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值,
|
||||
}
|
||||
|
||||
|
||||
sealed class Scene: IAttach
|
||||
interface Scene: IAttach
|
||||
|
||||
|
||||
/**
|
||||
* 默认视图
|
||||
* @param delay: 表示多少稍后,默认值为2
|
||||
* @param unit: 时间单位,默认为秒
|
||||
*/
|
||||
class Default(val delay: Long = 2, val unit: TimeUnit = SECONDS): Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
|
||||
override val priority: Int = 1
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = 0
|
||||
|
||||
override fun toString(): String {
|
||||
return "Default(delay=$delay, unit=$unit, angle=$angle, priority=$priority)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 道路事件
|
||||
*/
|
||||
class RoadEvent(val poi_lon: Double, val poi_lat: Double, val poi_angle: Double, val isGps: Boolean = true): Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MODE_LONG_SIGHT
|
||||
|
||||
override val priority: Int = 5
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = SECONDS.toMillis(8)
|
||||
|
||||
override fun toString(): String {
|
||||
return "RoadEvent(priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority}, lon: $poi_lon, lat: $poi_lat, angle: $poi_angle)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 十字路口
|
||||
*/
|
||||
class CrossRoad(var open: Boolean = false): Scene() {
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
override val priority: Int = 4
|
||||
override val displayThreshold: Long
|
||||
get() = -1
|
||||
|
||||
override fun toString(): String {
|
||||
return "CrossRoad(open: ${open}, priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority})"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user