[3.4.0-map-sdk] add func of cross road
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user