[6.5.0][通过公交站] fix: 高精地图api 调用线程及可能不回调问题优化;
This commit is contained in:
@@ -289,8 +289,8 @@ object MapDataWrapper : IMogoData {
|
||||
} ?: emptyList()
|
||||
}
|
||||
|
||||
override fun getBusStation(routeList: ArrayList<LonLatPoint>): MutableList<BusStation> {
|
||||
val latch = CountDownLatch(1)
|
||||
@Synchronized
|
||||
override fun getBusStation(routeList: ArrayList<LonLatPoint>, resultUnit:((MutableList<BusStation>) -> Unit)) {
|
||||
val resultList = mutableListOf<BusStation>()
|
||||
MapDataApi.getBusStation(routeList, object : IResult<RoutePath> {
|
||||
override fun result(code: Int, result: RoutePath?) {
|
||||
@@ -300,11 +300,9 @@ object MapDataWrapper : IMogoData {
|
||||
resultList.add(busStation)
|
||||
}
|
||||
}
|
||||
latch.countDown()
|
||||
resultUnit.invoke(resultList)
|
||||
}
|
||||
})
|
||||
latch.await()
|
||||
return resultList
|
||||
}
|
||||
|
||||
override fun getCrossRoad(lon: Double, lat: Double, angle: Double): CrossRoad? {
|
||||
|
||||
Reference in New Issue
Block a user