出行导航
传入起点、中途点、终点进行路线规划(导航、巡航中先退出)#
MapAuto 启动/未启动时,通过该接口可调起 MapAuto 并传入起点、终点、中途点进行路线规划。支持传入规划原则。若没有传起点,默认用当前车位。
参数说明
参数 | 说明 | 是否必填 | 格式 / 示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10041 |
S_LAT | 起点纬度 | 是 | double |
S_LON | 起点经度 | 是 | double |
SNAME | 起点名称 | 是 | String |
FMID_LAT | 第一个途经点纬度 | 是 | double |
FMID_LON | 第一个途经点经度 | 是 | double |
FMIDNAME | 第一个途经点名称 | 是 | String |
D_LAT | 终点纬度 | 是 | double |
D_LON | 终点经度 | 是 | double |
DNAME | 终点名称 | 是 | String |
ENCRYPTED | 起终点是否需要加密 | 是 | int =0(不需要国测加密 GCJ02) =1(需要国测加密 WGS84) |
PREFER | 路线偏好 | 否 | int =0(智能推荐) =1(时间优先) =2(距离优先) =3(躲避拥堵) =4(不走高速) =5(高速优先) 未设置沿用原来的偏好 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10041);
intent.putExtra("SNAME", "百度国际大厦");
intent.putExtra("S_LON", 113.94899);
intent.putExtra("S_LAT",22.530259);
intent.putExtra("FMIDNAME ","广州塔");
intent.putExtra("FMID_LON",113.331084);
intent.putExtra("FMID_LAT",23.112223);
intent.putExtra("DNAME","广州长隆欢乐世界");
intent.putExtra("D_LON",113.336814);
intent.putExtra("D_LAT",23.004785);
intent.putExtra("ENCRYPTED",0);
intent.putExtra("PREFER",0);
sendBroadcast(intent);
传入起点、终点进行路线规划(导航、巡航中先退出)#
MapAuto 启动/未启动时,通过该接口可调起 MapAuto 并传入起点、终点进行路线规划。支持传入规划原则
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10042 |
S_LAT | 起点纬度 | 是 | double |
S_LON | 起点经度 | 是 | double |
SNAME | 起点名称 | 是 | string |
D_LAT | 终点纬度 | 是 | double |
D_LON | 终点经度 | 是 | double |
DNAME | 终点名称 | 是 | string |
ENCRYPTED | 起终点是否需要加密 | 是 | int 0:不需要国测加密 1:需要国测加密 |
PREFER | 路线偏好 | 否 | int =0(智能推荐) =1(时间优先) =2(距离优先) =3(躲避拥堵) =4(不走高速) =5(高速优先) 未设置沿用原来的偏好 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10042);
intent.putExtra("SNAME", "深圳欢乐谷");
intent.putExtra("S_LON",113.987249);
intent.putExtra("S_LAT",22.547732);
intent.putExtra("DNAME","上海迪斯尼");
intent.putExtra("D_LON", 121.670502);
intent.putExtra("D_LAT",31.146232);
intent.putExtra("ENCRYPTED",0);
intent.putExtra("PREFER",0);
sendBroadcast(intent);
传入终点直接导航(导航、巡航中先退出)#
在 MAPAUTO 启动/未启动,第三方通过该接口可传入终点并调起 MapAuto 执行路线规划,MapAuto 以车标为起点规划路径并直接进入导航界面。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示MapAuto接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一ID | 是 | 10043 |
CALL_APP | 第三方应用名称 | 是 | string |
BD_POINAME | POI名称 | 是 | string |
BD_LAT | 纬度 | 是 | double |
BD_LON | 经度 | 是 | double |
ENCRYPTED | 是否需要加密 | 是 | int 0:不需要国测加密 1:需要国测加密 |
PREFER | 路线偏好 | 否 | int =0(智能推荐) =1(时间优先) =2(距离优先) =3(躲避拥堵) =4(不走高速) =5(高速优先) 未设置沿用原来的偏好 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10038);
intent.putExtra("BD_POINAME","深圳大学");
intent.putExtra("BD_LON",113.942762);
intent.putExtra("BD_LAT",22.537952);
intent.putExtra("ENCRYPTED",0);
intent.putExtra("PREFER",0);
intent.putExtra("CALL_APP","Other App");
sendBroadcast(intent);
导航偏好设置#
通过该接口可在导航场景下控制路线偏好,仅在导航场景下生效。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10044 |
NAVI_ROUTE_PREFER | 路线偏好 | 是 | int =0(智能推荐) =1(时间优先) =2(距离优先) =3(躲避拥堵) =4(不走高速) =5(高速优先) |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10044);
intent.putExtra("NAVI_ROUTE_PREFER", 0);
sendBroadcast(intent);
结束导航(导航中支持,回到首页)#
通过该接口可通知 MapAuto 结束引导,退出导航状态,回到主图界面。
参数说明
参数 | 说明 | 是否必填 | 格式 / 示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10045 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10045);
sendBroadcast(intent);
路线方案选择#
该接口支持第三方切换路线方案,仅支持 MapAuto 处于路线详情页界面。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示MapAuto接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一ID | 是 | 10046 |
CHANGE_ROAD | 路线选择结果 | 是 | int 1:第一条路线 2:第二条路线 3:第三条路线 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10046);
intent.putExtra("CHANGE_ROAD", 1);
sendBroadcast(intent);
模拟导航(只在算路结果页响应)#
进入模拟导航
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10047 |
使用示例
Intent intent = new Intent();
intent.setAction(" com.baidu.naviauto.action.recv ");
intent.putExtra("CMD_TYPE", 10047);
sendBroadcast(intent);
导航模式切换#
MapAuto 导航过程中,可以通过这个接口进行模式切换。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10048 |
KEY_NAVI_MODE | 导航模式 | 是 | int 1: 查看全程 2: 继续导航 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10048);
intent.putExtra("KEY_NAVI_MODE", 1);
sendBroadcast(intent);
声控电子狗(只在首页响应)#
电子狗的开关。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10049 |
ELE_DOG | 打开、关闭电子狗 | 是 | int 1:打开 2:关闭 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10049);
intent.putExtra("ELE_DOG", 1);
sendBroadcast(intent);
查询当前限速#
查询当前道路的限速。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10140 |
使用示例
Intent intent = new Intent();
intent.setAction("com.baidu.naviauto.action.recv");
intent.putExtra("CMD_TYPE", 10140);
sendBroadcast(intent);
查询当前限速结果返回#
查询当前道路的限速。未查询到返回 -1,正常返回具体的数值。
参数说明
参数 | 说明 | 是否必填 | 格式/示例 |
---|---|---|---|
Action | 表示 MapAuto 接收/发送广播 | 是 | com.baidu.naviauto.action.recv |
CMD_TYPE | 协议的唯一 ID | 是 | 10141 |
LIMIT_SPEED | 当前道路的限制速度 | 是 | int (km/h)120 |