{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671516336059,"data":{"id":71713004,"title":"5.4.3.2 导航引导基本信息","slug":"uo4gqt","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
INaviObserver.onUpdateNaviInfo,由HMI通过UI控件绘制在界面上。
导航基本信息透出的时序:
// 导航信息\npublic class NaviInfo {\n public long pathID; /**< path唯一id */ \n public int type; /**< 更新类型 */ \n public TimeAndDist routeRemain; /**< 路径剩余距离(单位米)和时间(单位秒) */ \n public ArrayList<TimeAndDist> viaRemain; /**< 自车到途经点的距离(单位米)和时间(单位秒) */ \n public ArrayList<TimeAndDist> ChargeStationRemain; /**< 自车到充电站的距离(单位米)和时间(单位秒) */ \n public int routeRemainLightCount; /**< 路径剩余红绿灯数 */ \n public int linkRemainDist; /**< 当前自车所在link剩余的距离(单位米) */ \n public int curSegIdx; /**< 当前自车所在segment段,从0开始 */ \n public int curLinkIdx; /**< 当前自车所在Link,从0开始 */ \n public int curPointIdx; /**< 当前车位在当前导航段上link中点索引 */ \n public int curRoadClass; /**< 当前自车所在道路等级 */ \n public String curRouteName; /**< 当前道路名称 */ \n public int ringOutCnt; /**< 环岛出口序号,不是个数 */ \n public int driveTime; /**< 实际的行驶用时,包括中途停车时间在内 */ \n public int driveDist; /**< 实际的行驶里程 */ \n public int cityCode; /**< 行政区编码 */ \n public int curLinkSpeed; /**< 当前link的历史行驶速度, 离线暂没有值 */ \n public int segTipsDis; /**< 气泡显示的剩余距离(骑步) */ \n public NotAvoidInfo notAvoidInfo; /**< 未避开的设施及禁行 */ \n public int crossManeuverID; /**< 路口转向ID,参见:ManeuverIconID */ \n public ArrayList<CrossNaviInfo> nextCrossInfo; /**< 下一路口信息 要透出该信息,需要配置引导语音配置表 */ \n public int NaviInfoFlag; /**< 标记当前标签板应该显示的信息是NaviInfoData的哪一个,有效值(0/1)参考NaviInfoPanel */ \n public ArrayList<NaviInfoPanel> NaviInfoData; /**< NaviInfo标签板显示内容专用 */ \n}\n// 时间、距离\npublic class TimeAndDist {\n public int time;\t/**< 时间 */\n public int dist;\t/**< 距离 */\n}\n// 路口信息\npublic class CrossNaviInfo {\n public long pathID;\t\t\t\t/**< path唯一id */\t\n public int segIdx;\t\t\t\t/**< 当前所在segment段,从0开始 */\t\t\n public int mainAction;\t\t\t/**< 导航动作 */\t\n public int assistAction;\t\t/**< 导航辅助动作 */\t\n public int maneuverID;\t\t\t/**< 满足顺行展示距离时为顺行图标,否则同crossManeuverID 见枚举 ManeuverIconID*/\t\n public int crossManeuverID;\t\t/**< 路口转向ID 见枚举 ManeuverIconID*/\t\n public String nextRoadName;\t\t/**< 下条道路名称,途经点为途经点或者目的地名称,UTF16 */\t\n public int curToSegmentDist;\t/**< 当前车位所在导航段终点到segIdx终点的距离(单位米) */\t\n public int curToSegmentTime;\t/**< 当前车位所在导航段终点到segIdx终点的时间(单位秒) */\t\t\n public short outCnt;\t\t\t/**< 进入环岛时为环岛出口数;隧道内分叉为分叉个数 */\t\n public short viaNum;\t\t\t/**< 途经点、充电站编号 */\t\n public short destDirection;\t\t/**< 途经点、充电站、目的地相对路径的位置关系,1:left;2:right */\t\n public short tunnelFlag;\t\t/**< 是否为隧道内外分叉,1:隧道内分叉;2:隧道外分叉 */\t\n public short reversed;\t\t\t/**< 保留字段 */\n public short rev;\t\t\t\t/**< 保留字段 */\n}\n// 引导标签板信息 \npublic class NaviInfoPanel {\n public int maneuverID;\t\t\t\t/**< 动态转向ID,满足顺行展示距离时为顺行图标,过了顺行距离同crossManeuverID */\n public TimeAndDist segmentRemain;\t/**< 当前导航段剩余距离(单位米)和剩余时间(单位秒) */\t\n public String nextRouteName;\t\t/**< 下条道路名称 */\n public int nextRoadNameSegIdx;\t\t/**< 下条道路名称所在的SegIdx */\n public int nextRoadNameLinkIdx;\t\t/**< 下条道路名称所在的linkIdx */\n public int split;\t\t\t\t\t/**< 当前导航段是否被拆分,0 未拆分,1 拆分的第一段,2 拆分的第二段。 */\n}
void com.autonavi.gbl.guide.observer.INaviObserver.onUpdateNaviInfo(ArrayList<NaviInfo> naviInfoList)
说明:函数详情,请复制函数名称到在线API搜索
//实现观察者INaviObserver\nINaviObserver naviObserver = new INaviObserver() {\n\t@Override\n //引导基本信息透出示例代码\n\tpublic void onUpdateNaviInfo(ArrayList<NaviInfo> arrayList) {\n // 路径剩余时间、距离\n\t\tint routeRemainTime = arrayList.get(0).routeRemain.time;\n\t\tint routeRemainDist = arrayList.get(0).routeRemain.dist;\n\t\t// 当前标签板的内容\n\t\tNaviInfoPanel naviInfoPanel = arrayList.get(0).NaviInfoData.get(arrayList.get(0).NaviInfoFlag);\n\t\t// 转向ID\n\t\tint maneuverID = naviInfoPanel.maneuverID;\n\t\t// 当前导航段的剩余时间、距离\n\t\tint segmentRemainTime = naviInfoPanel.segmentRemain.time;\n\t\tint segmentRemainDist = naviInfoPanel.segmentRemain.dist;\n\t\t// 下条道路名称\n\t\tString nextRouteName = naviInfoPanel.nextRouteName;\n\t\t// 下个路口信息\n\t\tif (arrayList.get(0).nextCrossInfo.size() > 0){\n\t\t\tCrossNaviInfo nextCrossInfo = arrayList.get(0).nextCrossInfo.get(0);\n\t\t\t// 近接动作ID(下个动作ID)\n\t\t\tint nextManeuverID = nextCrossInfo.maneuverID;\n\t\t\t// 当前车位所在导航段终点到segIdx终点的距离(单位米) : 即: 下个动作距离\n\t\t\tint curToSegmentDist = nextCrossInfo.curToSegmentDist;\n\t\t}\n\t\t// todo ...\n // HMI根据NaviInfo信息,绘制在UI上\n\t}\n ...\n};
六、注意事项
610及以上版本,需HMI手动开启动态运营(需对接场景组件),否则部分服务区将无法透出设施详情(sapaDetail为0)
对接示例代码:
// 获取场景组件服务(一级服务)\nmSceneModuleService=ServiceMgr.getServiceMgrInstance().getBLService(SingleServiceID.SceneModuleSingleServiceID);\n\n\n// 统一初始化场景组件服务\nInitSceneModuleParamparam;\nparam.bEnableDynamicCloudShowInfoModule=True;// 开启动态运营组件\nmSceneModuleService.init(param);
若有收获,就点个赞吧