路径绑定测试
This commit is contained in:
@@ -317,34 +317,34 @@ class MainViewModel @Inject constructor(
|
|||||||
MapParamUtils.setTaskId(sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1))
|
MapParamUtils.setTaskId(sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1))
|
||||||
socketServer = SocketServer(mapController, traceDataBase, sharedPreferences)
|
socketServer = SocketServer(mapController, traceDataBase, sharedPreferences)
|
||||||
|
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
// viewModelScope.launch(Dispatchers.Default) {
|
||||||
naviTestFlow().collect {
|
// naviTestFlow().collect {
|
||||||
naviMutex.lock()
|
// naviMutex.lock()
|
||||||
if (naviEngine.geometry != null) {
|
// if (naviEngine.geometry != null) {
|
||||||
//定义垂线
|
// //定义垂线
|
||||||
val pointPairDistance = PointPairDistance()
|
// val pointPairDistance = PointPairDistance()
|
||||||
val coordinate = Coordinate(it.longitude, it.latitude)
|
// val coordinate = Coordinate(it.longitude, it.latitude)
|
||||||
DistanceToPoint.computeDistance(
|
// DistanceToPoint.computeDistance(
|
||||||
naviEngine.geometry,
|
// naviEngine.geometry,
|
||||||
coordinate,
|
// coordinate,
|
||||||
pointPairDistance
|
// pointPairDistance
|
||||||
)
|
// )
|
||||||
if (pointPairDistance.getCoordinate(0) !== null) {
|
// if (pointPairDistance.getCoordinate(0) !== null) {
|
||||||
val line = GeometryTools.createLineString(
|
// val line = GeometryTools.createLineString(
|
||||||
mutableListOf(
|
// mutableListOf(
|
||||||
it,
|
// it,
|
||||||
GeoPoint(
|
// GeoPoint(
|
||||||
pointPairDistance.getCoordinate(0).y,
|
// pointPairDistance.getCoordinate(0).y,
|
||||||
pointPairDistance.getCoordinate(0).x
|
// pointPairDistance.getCoordinate(0).x
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
mapController.lineHandler.showLine(line.toText())
|
// mapController.lineHandler.showLine(line.toText())
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
naviMutex.unlock()
|
// naviMutex.unlock()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -499,8 +499,7 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
naviEngine.routeList = pathList
|
naviEngine.routeList = newRouteList
|
||||||
mapController.lineHandler.showLine(naviEngine.geometry!!.toText())
|
|
||||||
naviMutex.unlock()
|
naviMutex.unlock()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user