本页面主要介绍历史轨迹查询,用户可以查询历行程信息。
使用步骤
let historyManager = this.historyManager ?? new HistoryTraceManager()
historyManager.setOnHistoryTraceListener(this)/*** 查询(司机)历史轨迹数据回调** @param status 请求历史轨迹数据状态码* @param message 请求历史轨迹数据状态描述* @param historyTraceData 历史轨迹数据*/onQueryHistoryTraceData(status: number, message: string, historyTraceData?: HistoryTraceData | undefined): void {this.queryHistoryTraceDataBack?.(status, message, historyTraceData)if (status != 0) {promptAction.showToast({ message: `历史查询渲染失败(${message})` })return}const mapController = this._mapControllerconst historyManager = this.historyManagerif (mapController === undefined || historyTraceData === undefined || historyManager === undefined) {return}historyManager.renderHistoryTrace(mapController, historyTraceData,new HistoryTraceDisplayOptions.Builder().setShowOption(HistoryTraceDisplayOptions.SHOW_START_POSITION_ICON| HistoryTraceDisplayOptions.SHOW_END_POSITION_ICON |HistoryTraceDisplayOptions.SHOW_ROUTE_PLAN).build(),this._orderState)}/*** 在地图上绘制(司机)历史轨迹** @param status 绘制历史轨迹数据状态码* @param message 绘制历史轨迹数据状态描述*/onRenderHistoryTrace(status: number, message: string): void {this.renderHistoryTraceBack?.(status, message)}
historyManager.queryHistoryTraceData(new HistoryTraceQueryOptions.Builder().setOrderId(this._roleOptions.orderId ?? '').setRoleType(RoleType.ROUTE_ID_PASSENGER).setUserId(this._roleOptions.userId ?? '').setDriverId(this._roleOptions.driverId ?? '').setQueryOrderState(OrderState.LBS_ORDER_STATE_UNSPECIFIED).setCurrentOrderState(OrderState.LBS_ORDER_STATE_ORDER_COMPLETE).build())
上一篇
下一篇
本篇文章对您是否有帮助?