[6.5.0][通过公交站] fix: 高精地图api 调用线程及可能不回调问题优化;

This commit is contained in:
aibingbing
2024-07-17 16:19:43 +08:00
parent 58a15194d3
commit 5419046bb6
3 changed files with 46 additions and 26 deletions

View File

@@ -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? {