[1.1.2]
[距离问题、包含问题]
This commit is contained in:
yangyakun
2023-03-05 22:31:04 +08:00
parent 9d5e66edc3
commit e9d2c5a7cb
5 changed files with 108 additions and 10 deletions

View File

@@ -14,8 +14,8 @@ data class OrderInfoResponse(val data: OrderInfo?) : BaseData() {
val lineName: String?,//线路名称
val siteId: Long?,//站点id
val siteName: String?,//站点名称
val wgs84Lat: Double?,//高精地图
val wgs84Lon: Double?,//高精地图
val wgs84Lat: Double?,
val wgs84Lon: Double?,
val startTime: Long?,//开始时间
val endTime: Long?,//结束时间
val passengerPhone: String?,//乘客手机号

View File

@@ -531,6 +531,8 @@ object CharterPassengerModel {
//设置全局轨迹信息
locusInfo = data.data
CallerLogger.d(M_BUS_P+TAG,"查询自动驾驶轨迹信息")
CallerLogger.d(M_BUS_P+TAG,GsonUtil.jsonFromObject(
locusInfo))
}
override fun onFail(code: Int, msg: String) {
@@ -559,11 +561,12 @@ object CharterPassengerModel {
* 查询车辆状态 判断订单是否结束、是否显示结束业务
*/
private fun calculateDistance() {
//mLocation gcj坐标
mLocation?.let {
// 启动轨迹计算
//当前站在轨迹中对应的点
val currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(
0, mRoutePoints, it.latitude, it.longitude
0, mRoutePoints, it.longitude, it.latitude
)
//要前往的站在轨迹中对应的点
var nextRouteIndex: Int = mRoutePoints.size - 1
@@ -574,8 +577,9 @@ object CharterPassengerModel {
)
}
var lastSumLength = 0f
if (currentRouteIndex < nextRouteIndex) {//
val subList = mRoutePoints.subList(currentRouteIndex, nextRouteIndex)
if (currentRouteIndex < nextRouteIndex) {
// subList 是[) 需要的是[]
val subList = mRoutePoints.subList(currentRouteIndex, nextRouteIndex+1)
val middlePoingDistancee =
CoordinateCalculateRouteUtil.calculateRouteSumLength(subList)
val lastPoints = mRoutePoints.get(currentRouteIndex)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
package com.mogo.och.bus.passenger
data class Model(
val models: List<ModelX>
)

View File

@@ -0,0 +1,11 @@
package com.mogo.och.bus.passenger
data class ModelX(
val altitude_: Double,
val heading_: Double,
val latitude_: Double,
val longitude_: Double,
val memoizedHashCode: Int,
val memoizedIsInitialized: Int,
val memoizedSize: Int,
)