{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671508931322,"data":{"id":71712747,"title":"9.6.5 Amap推送路线消息","slug":"mlxgub","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
Amap推送路线消息是Amap推送分享到车机的导航路线消息。
注意: Amap推送路线消息的接收必须开启消息监听,开启监听之前需要是登录状态,并且与Amap登录同一个账号。
【AimRoutePushInfo中的naviId字段,HMI需要填写到发起路线还原请求的RouteService.requestRouteRestoration.setNaviId接口中】
void com.autonavi.gbl.user.msgpush.observer.IMsgPushServiceObserver.notifyMessage(AimRoutePushMsg)
ArrayList<AimRoutePushMsg> com.autonavi.gbl.user.msgpush.MsgPushService.getAimRoutePushMessages()
int com.autonavi.gbl.user.msgpush.MsgPushService.updateAimRouteEndPoiName(long, String)
说明:函数详情,请复制函数名称到在线API搜索
public class PushPresenter implements IMsgPushServiceObserver {\n // 路线消息通知\n @Override\n public void notifyMessage(AimRoutePushMsg aimRoutePushMsg) {\n // 路线还原\n RouteRestorationOption routeRestorationOption = RouteRestorationOption.create();\n \n RoutepathrestorationPathInfo path = aimRoutePushMsg.content.path;\n routeRestorationOption.setPaths(path.paths);\n routeRestorationOption.setStartPoints(path.startPoints.points);\n // routeRestorationOption.setViaPoints(path.viaPoints.points); // 目前开放项目不支持途径点设置\n routeRestorationOption.setEndPoints(path.endPoints.points);\n\n MobileRouteParam routeParam = aimRoutePushMsg.content.routeParam;\n routeRestorationOption.setEndName(routeParam.destination.name);\n routeRestorationOption.setContentOption(routeParam.contentOption);\n\n routeRestorationOption.setRouteVer(RouteService.getRouteVersion());\n routeRestorationOption.setSdkVer(RouteService.getEngineVersion());\n\n MobileVehicleInfo vehicle = routeParam.vehicle;\n routeRestorationOption.setCarType(vehicle.type);\n routeRestorationOption.setCarSize(vehicle.size);\n routeRestorationOption.setCarHeight(vehicle.height);\n routeRestorationOption.setCarWidth(vehicle.width);\n routeRestorationOption.setCarLoad(vehicle.load);\n routeRestorationOption.setCarWeight(vehicle.weight);\n routeRestorationOption.setCarAxis(vehicle.axis);\n routeRestorationOption.setCarPlate(vehicle.plate);\n routeRestorationOption.setNaviId(aimRoutePushMsg.content.naviId);\n\n int i = mRouteService.requestRouteRestoration(routeRestorationOption);\n routeRestorationOption.delete();//销毁\n }\n}\n\n// 获取路线消息\nArrayList<AimRoutePushMsg> autoPoiMsgList = PushPresenter.getInstance().getAimRoutePushMessages();\n\n// 修改手机推送的路线终点POI的名称\nlong msgId = 0; // 消息ID, SDK推送消息透出 对应字段 MsgPushItem.messageId\nString newName = ""; // 修改后的POI名称\nPushPresenter.getInstance().updateAimRouteEndPoiName(msgId, newName);\n
路线消息中保存的是手机端算路时的路网场景对应的LinkId,路网更新后将对应的LinkId也就失效了,需要通过算路的方式还原路线。