[3.4.0-map-sdk] add func of cross road

This commit is contained in:
zhongchao
2023-09-20 09:53:19 +08:00
parent eeeb7eb026
commit c84e4a8793
2 changed files with 66 additions and 35 deletions

View File

@@ -1,15 +1,19 @@
package com.mogo.eagle.core.function.call.map
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.zhidaoauto.map.data.road.StopLine
import java.util.concurrent.ConcurrentHashMap
import kotlin.properties.Delegates
object CallerMapRoadListenerManager {
interface OnRoadListener {
fun onRoadIdInfo(roadId: String)
fun onRoadIdInfo(roadId: String){}
fun onStopLineInfo(info: StopLine)
fun onStopLineInfo(info: StopLine){}
fun onRoadChange(cross: Boolean){}
}
private val listeners by lazy {
@@ -42,4 +46,18 @@ object CallerMapRoadListenerManager {
entry.value.onStopLineInfo(stopLine)
}
}
private var mCross: Boolean by Delegates.observable(false) { _, oldValue, newValue ->
if(oldValue != newValue){
Logger.d("emArrow","cross : $newValue")
listeners.forEach { entry ->
entry.value.onRoadChange(newValue)
}
}
}
fun invokeRoadChange(cross: Boolean) {
mCross = cross
}
}