public interface AMapNaviListener
注:回调在主线程触发
Note: Callbacks are triggered on the main thread
| 限定符和类型 | 方法和说明 |
|---|---|
void |
hideCross()
关闭路口放大图回调(实景图)
Close intersection enlargement map callback (real scene map). |
void |
hideLaneInfo()
关闭道路信息回调
Close road information callback. |
void |
hideModeCross()
关闭路口放大图回调(模型图)
Close intersection enlargement map callback (model map). |
void |
notifyParallelRoad(int parallelRoadType)
已过时。
|
void |
onArriveDestination()
到达目的地后回调函数
Callback function after reaching the destination. |
void |
onArrivedWayPoint(int wayID)
驾车路径导航到达某个途经点的回调函数
Callback function when driving route navigation reaches a waypoint. |
void |
onCalculateRouteFailure(AMapCalcRouteResult routeResult)
路线规划失败回调,包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算,具体算路结果可以通过
AMapCalcRouteResult获取Route planning failure callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. |
void |
onCalculateRouteFailure(int errorInfo)
已过时。
该方法在6.1.0版本废弃,但是还会正常回调,建议使用
AMapNaviListener.onCalculateRouteFailure(AMapCalcRouteResult) 方法替换This method was deprecated in version 6.1.0, but will still callback normally. It is recommended to use AMapNaviListener.onCalculateRouteFailure(AMapCalcRouteResult) method instead |
void |
onCalculateRouteSuccess(AMapCalcRouteResult routeResult)
路线规划成功回调,包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算,具体算路结果可以通过
AMapCalcRouteResult获取Route planning success callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. |
void |
onCalculateRouteSuccess(int[] routeIds)
已过时。
该方法在6.1.0版本废弃,但是还会正常回调,建议使用
AMapNaviListener.onCalculateRouteSuccess(AMapCalcRouteResult) 方法替换This method was deprecated in version 6.1.0, but will still callback normally. It is recommended to use AMapNaviListener.onCalculateRouteSuccess(AMapCalcRouteResult) method instead |
void |
onEndEmulatorNavi()
模拟导航停止后回调函数
Callback function after simulated navigation stops. |
void |
onGetNavigationText(int type,
java.lang.String text)
导航播报信息回调函数
Navigation broadcast information callback function. |
void |
onGetNavigationText(java.lang.String text)
已过时。
|
void |
onGpsOpenStatus(boolean enabled)
用户手机位置信息设置是否开启的回调函数
Callback function for whether the user's phone location information setting is enabled. |
void |
onGpsSignalWeak(boolean isWeak)
手机卫星定位信号强弱变化的回调
Callback for changes in mobile phone satellite positioning signal strength |
void |
onInitNaviFailure()
导航初始化失败时的回调函数
Callback function when navigation initialization fails. |
void |
onInitNaviSuccess()
导航初始化成功时的回调函数
Callback function when navigation initialization succeeds. |
void |
onLocationChange(AMapNaviLocation location)
当位置信息有更新时的回调函数
Callback function when position information is updated. |
void |
onNaviInfoUpdate(NaviInfo naviInfo)
导航引导信息回调
Navigation guidance information callback. |
void |
onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)
导航过程中道路信息通知
Road information notification during navigation. |
void |
onPlayRing(int type)
回调各种类型的提示音,类似高德导航"叮"
Callback for various types of prompt sounds, similar to Amap navigation "ding". |
void |
onReCalculateRouteForTrafficJam()
驾车导航时,当前方遇到拥堵时准备重新规划路线前的通知回调
Notification callback before preparing to recalculate route when encountering traffic jams ahead during driving navigation. |
void |
onReCalculateRouteForYaw()
偏航后准备重新规划路线前的通知回调
Notification callback before preparing to recalculate route after yaw. |
void |
onServiceAreaUpdate(AMapServiceAreaInfo[] infoArray)
服务区信息回调函数
Service area information callback function 注意:该接口仅驾车模式有效 Note: This interface is only valid in driving mode |
void |
onStartNavi(int type)
启动导航后的回调函数
Callback function after starting navigation |
void |
onTrafficStatusUpdate()
当前方路况光柱信息有更新时回调函数
Callback function when current traffic light column information is updated. |
void |
OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo)
已过时。
|
void |
OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] infos)
已过时。
已过期,建议使用
AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])Deprecated, it is recommended to use AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[]) |
void |
showCross(AMapNaviCross aMapNaviCross)
显示路口放大图回调(实景图)
Display intersection enlargement map callback (real scene map). |
void |
showLaneInfo(AMapLaneInfo laneInfo)
显示道路信息回调
Display road information callback. |
void |
showLaneInfo(AMapLaneInfo[] laneInfos,
byte[] laneBackgroundInfo,
byte[] laneRecommendedInfo)
已过时。
建议使用
AMapNaviListener.showLaneInfo(AMapLaneInfo) 方法替换It is recommended to use AMapNaviListener.showLaneInfo(AMapLaneInfo) method instead |
void |
showModeCross(AMapModelCross modelCross)
显示路口放大图回调(模型图)
Display intersection enlargement map callback (model map). |
void |
updateAimlessModeCongestionInfo(AimLessModeCongestionInfo aimLessModeCongestionInfo)
已过时。
已过期,建议使用
AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo)Deprecated, it is recommended to use AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo) |
void |
updateCameraInfo(AMapNaviCameraInfo[] infoArray)
导航过程中的摄像头信息回调函数
Camera information callback function during navigation 注意:该接口仅驾车模式有效 Note: This interface is only valid in driving mode |
void |
updateIntervalCameraInfo(AMapNaviCameraInfo startCameraInfo,
AMapNaviCameraInfo endCameraInfo,
int status)
导航过程中的区间测速信息回调函数
Interval speed measurement information callback function during navigation 注意:该接口仅驾车模式有效 Note: This interface is only valid in driving mode |
void onInitNaviFailure()
void onInitNaviSuccess()
void onStartNavi(int type)
void onTrafficStatusUpdate()
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
void onLocationChange(AMapNaviLocation location)
location - 当前位置的定位信息。void onGetNavigationText(int type,
java.lang.String text)
type - 播报类型枚举,详情见 NaviTTSTypeNaviTTSTypetext - 播报文案void onGetNavigationText(java.lang.String text)
text - 播报文字。void onEndEmulatorNavi()
void onArriveDestination()
void onCalculateRouteFailure(int errorInfo)
AMapNaviListener.onCalculateRouteFailure(AMapCalcRouteResult) 方法替换AMapNaviListener.onCalculateRouteFailure(AMapCalcRouteResult) method insteaderrorInfo - 参见PathPlanningErrCodePathPlanningErrCodevoid onReCalculateRouteForYaw()
此方法只是通知准备重算事件,开发者不需要在方法中触发算路逻辑,SDK内部会进行算路。
This method only notifies the preparation for recalculation event. Developers do not need to trigger the routing logic in the method, as the SDK will perform routing internally.
void onReCalculateRouteForTrafficJam()
此方法只是通知准备重算事件,开发者不需要在方法中触发算路逻辑,SDK内部会进行算路。
This method only notifies the preparation for recalculation event. Developers do not need to trigger the routing logic in the method, as the SDK will perform routing internally.
void onArrivedWayPoint(int wayID)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
wayID - 到达途径点的编号,标号从0开始,依次累加。void onGpsOpenStatus(boolean enabled)
enabled - true,开启;false,未开启。void onNaviInfoUpdate(NaviInfo naviInfo)
naviInfo - 导航信息类对象。void updateCameraInfo(AMapNaviCameraInfo[] infoArray)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
infoArray - 摄像头对象数组void updateIntervalCameraInfo(AMapNaviCameraInfo startCameraInfo, AMapNaviCameraInfo endCameraInfo, int status)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
startCameraInfo - 区间测速起点信息endCameraInfo - 区间测速终点信息status - 具体类型可参考CarEnterCameraStatusCarEnterCameraStatusvoid onServiceAreaUpdate(AMapServiceAreaInfo[] infoArray)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
infoArray - 服务区对象数组void showCross(AMapNaviCross aMapNaviCross)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
aMapNaviCross - 路口放大图类,可以获得此路口放大图bitmapvoid hideCross()
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
void showModeCross(AMapModelCross modelCross)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
modelCross - 模型图数据类,可以获取绘制模型图需要的矢量数据void hideModeCross()
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
void showLaneInfo(AMapLaneInfo[] laneInfos, byte[] laneBackgroundInfo, byte[] laneRecommendedInfo)
AMapNaviListener.showLaneInfo(AMapLaneInfo) 方法替换AMapNaviListener.showLaneInfo(AMapLaneInfo) method instead
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
laneInfos - 道路信息数组,可获得当前道路信息,可用于用户使用自己的素材完全自定义显示。laneBackgroundInfo - 道路背景数据数组,可用于装载官方的DriveWayView,并显示。laneRecommendedInfo - 道路推荐数据数组,可用于装载官方的DriveWayView,并显示。void showLaneInfo(AMapLaneInfo laneInfo)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
laneInfo - 道路信息,可获得当前道路信息,可用于用户使用自己的素材完全自定义显示。void hideLaneInfo()
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
void onCalculateRouteSuccess(int[] routeIds)
AMapNaviListener.onCalculateRouteSuccess(AMapCalcRouteResult) 方法替换AMapNaviListener.onCalculateRouteSuccess(AMapCalcRouteResult) method instead
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
routeIds - 路线id数组void notifyParallelRoad(int parallelRoadType)
ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
parallelRoadType - 0表示隐藏 1 表示显示主路 2 表示显示辅路void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] infos)
AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
infos - 道路设施信息void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo)
AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
aMapNaviTrafficFacilityInfo - void updateAimlessModeCongestionInfo(AimLessModeCongestionInfo aimLessModeCongestionInfo)
AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo)AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo)
连续5个点大于15km/h后开始回调。
Callback starts after 5 consecutive points greater than 15km/h.
注意:void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo);
/**
巡航模式(无路线规划)下,统计信息更新回调
Route calculation success callback.
/**
巡航模式(无路线规划)下,拥堵信息更新回调
Traffic jam information update callback in cruise mode (without route planning).
当前方无拥堵信息时,回调的AimLessModeCongestionInfo对象为空。
When there is no traffic jam information ahead, the callback AimLessModeCongestionInfo object is empty.
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
aimLessModeCongestionInfo - void onPlayRing(int type)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
type - 提示音类型,可以根据类型自定义播放声音
从5.5.0版本开始,提示音类型使用常量表示,具体类型可参考AMapNaviRingType
Starting from version 5.5.0, prompt sound types are represented by constants, specific types can be referenced in AMapNaviRingType
AMapNaviRingTypevoid onCalculateRouteSuccess(AMapCalcRouteResult routeResult)
AMapCalcRouteResult获取AMapCalcRouteResult.
可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
Route calculation error code, route type, and route ID can be obtained through CalcRouteResult
routeResult - AMapCalcRouteResultvoid onCalculateRouteFailure(AMapCalcRouteResult routeResult)
AMapCalcRouteResult获取AMapCalcRouteResult
可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
Route calculation error code, route type, and route ID can be obtained through CalcRouteResult
routeResult - AMapCalcRouteResultvoid onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
导航过程中针对拥堵区域、限行区域、禁行区域、道路封闭等情况的躲避通知。
Avoidance notifications for traffic jam areas, restricted areas, prohibited areas, road closures, etc. during navigation.
通知和避让信息结果可以通过AMapNaviRouteNotifyData获取
Notification and avoidance information results can be obtained through AMapNaviRouteNotifyData
notifyData - 通知和避让信息,详细信息请参考AMapNaviRouteNotifyDataAMapNaviRouteNotifyData for detailed informationvoid onGpsSignalWeak(boolean isWeak)
isWeak - true: 信号弱;false:信号强