[6.5.0] refactor: 通过公交站 线程优化;
This commit is contained in:
@@ -4,7 +4,7 @@ import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
|
||||
data class BusStation(
|
||||
var busStationPoints: List<com.zhidaoauto.map.data.point.LonLatPoint>,
|
||||
var id: Int,
|
||||
var id: Long,
|
||||
var roadId: Int,
|
||||
var type: Int,
|
||||
var notifyTime: Long = -1,
|
||||
@@ -12,7 +12,11 @@ data class BusStation(
|
||||
) {
|
||||
|
||||
fun getBusStationId(): String {
|
||||
return "bus_station_${id}_${roadId}"
|
||||
//id=0 需要计算出一个唯一id
|
||||
val newId = getBusStationPoint()?.let {
|
||||
it.latitude + it.longitude
|
||||
} ?: 0
|
||||
return "bus_station_${newId}_${roadId}"
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -295,8 +295,8 @@ object MapDataWrapper : IMogoData {
|
||||
MapDataApi.getBusStation(routeList, object : IResult<RoutePath> {
|
||||
override fun result(code: Int, result: RoutePath?) {
|
||||
result?.steps?.forEach {
|
||||
it?.busStations?.forEach {
|
||||
val busStation = BusStation(it.busStationPoints, it.id, it.roadId, it.type, -1, -1)
|
||||
it?.busStations.forEach {
|
||||
val busStation = BusStation(it.busStationPoints, it.id.toLong() , it.roadId, it.type, -1, -1)
|
||||
resultList.add(busStation)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user