com.amap.api.navi

## 接口 AMapNaviListener

- 所有已知子接口:
    AMapNaviDriveListener, AMapNaviProListener, AMapNaviTravelListener
  所有已知实现类:
    AMapHudView, AMapNaviParkLimitControl, SimpleNaviListener

      public interface AMapNaviListener

  导航事件监听
  Navigation event listener

  注：回调在主线程触发
  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)` 已过时。 已过期，请使用`ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)` Deprecated, please use `ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)`
    `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

- - ### 方法详细资料

    - #### onInitNaviFailure

          void onInitNaviFailure()

      导航初始化失败时的回调函数
      Callback function when navigation initialization fails.

    - #### onInitNaviSuccess

          void onInitNaviSuccess()

      导航初始化成功时的回调函数
      Callback function when navigation initialization succeeds.

    - #### onStartNavi

          void onStartNavi(int type)

      启动导航后的回调函数
      Callback function after starting navigation
      参数:
        `type` - 导航类型参见`NaviType`
        Navigation type, see `NaviType`

    - #### onTrafficStatusUpdate

          void onTrafficStatusUpdate()

      当前方路况光柱信息有更新时回调函数
      Callback function when current traffic light column information is updated.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

    - #### onLocationChange

          void onLocationChange(AMapNaviLocation location)

      当位置信息有更新时的回调函数
      Callback function when position information is updated.
      参数:
        `location` - 当前位置的定位信息。
        Current position location information.

    - #### onGetNavigationText

          void onGetNavigationText(int type,
                                   java.lang.String text)

      导航播报信息回调函数
      Navigation broadcast information callback function.
      参数:
        `type` - 播报类型枚举，详情见 `NaviTTSType`
        Broadcast type enumeration, see details in `NaviTTSType`
        `text` - 播报文案
        Broadcast text

    - #### onGetNavigationText

          void onGetNavigationText(java.lang.String text)

      已过时。
      导航播报信息回调函数
      Navigation broadcast information callback function.
      参数:
        `text` - 播报文字。
        Broadcast text.
      从以下版本开始:
        5.3.0

    - #### onEndEmulatorNavi

          void onEndEmulatorNavi()

      模拟导航停止后回调函数
      Callback function after simulated navigation stops.

    - #### onArriveDestination

          void onArriveDestination()

      到达目的地后回调函数
      Callback function after reaching the destination.

    - #### onCalculateRouteFailure

          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
      步行或者驾车路径规划失败后的回调函数
      Callback function after walking or driving route planning fails.
      参数:
        `errorInfo` - 参见`PathPlanningErrCode`
        See `PathPlanningErrCode`

    - #### onReCalculateRouteForYaw

          void onReCalculateRouteForYaw()

      偏航后准备重新规划路线前的通知回调
      Notification callback before preparing to recalculate route after yaw.

      此方法只是通知准备重算事件，开发者不需要在方法中触发算路逻辑，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.

    - #### onReCalculateRouteForTrafficJam

          void onReCalculateRouteForTrafficJam()

      驾车导航时，当前方遇到拥堵时准备重新规划路线前的通知回调
      Notification callback before preparing to recalculate route when encountering traffic jams ahead during driving navigation.

      此方法只是通知准备重算事件，开发者不需要在方法中触发算路逻辑，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.

    - #### onArrivedWayPoint

          void onArrivedWayPoint(int wayID)

      驾车路径导航到达某个途经点的回调函数
      Callback function when driving route navigation reaches a waypoint.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `wayID` - 到达途径点的编号，标号从0开始，依次累加。
        The number of the reached waypoint, numbered starting from 0 and increasing sequentially.

    - #### onGpsOpenStatus

          void onGpsOpenStatus(boolean enabled)

      用户手机位置信息设置是否开启的回调函数
      Callback function for whether the user's phone location information setting is enabled.
      参数:
        `enabled` - true,开启;false,未开启。
        true, enabled; false, not enabled.

    - #### onNaviInfoUpdate

          void onNaviInfoUpdate(NaviInfo naviInfo)

      导航引导信息回调
      Navigation guidance information callback.
      参数:
        `naviInfo` - 导航信息类对象。
        Navigation information class object.

    - #### updateCameraInfo

          void updateCameraInfo(AMapNaviCameraInfo[] infoArray)

      导航过程中的摄像头信息回调函数
      Camera information callback function during navigation

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `infoArray` - 摄像头对象数组
        Camera object array
      从以下版本开始:
        5.0.0

    - #### updateIntervalCameraInfo

          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

      参数:
        `startCameraInfo` - 区间测速起点信息
        Interval speed measurement start point information
        `endCameraInfo` - 区间测速终点信息
        Interval speed measurement end point information
        `status` - 具体类型可参考`CarEnterCameraStatus`
        Specific types can be referenced in `CarEnterCameraStatus`
      从以下版本开始:
        6.0.0

    - #### onServiceAreaUpdate

          void onServiceAreaUpdate(AMapServiceAreaInfo[] infoArray)

      服务区信息回调函数
      Service area information callback function

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `infoArray` - 服务区对象数组
        Service area object array
      从以下版本开始:
        5.0.0

    - #### showCross

          void showCross(AMapNaviCross aMapNaviCross)

      显示路口放大图回调(实景图)
      Display intersection enlargement map callback (real scene map).

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `aMapNaviCross` - 路口放大图类，可以获得此路口放大图bitmap
        Intersection enlargement map class, can obtain the bitmap of this intersection enlargement map
      从以下版本开始:
        1.5.0

    - #### hideCross

          void hideCross()

      关闭路口放大图回调(实景图)
      Close intersection enlargement map callback (real scene map).

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      从以下版本开始:
        1.5.0

    - #### showModeCross

          void showModeCross(AMapModelCross modelCross)

      显示路口放大图回调(模型图)
      Display intersection enlargement map callback (model map).

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `modelCross` - 模型图数据类,可以获取绘制模型图需要的矢量数据
        Model map data class, can obtain vector data needed to draw the model map
      从以下版本开始:
        5.0.0

    - #### hideModeCross

          void hideModeCross()

      关闭路口放大图回调(模型图)
      Close intersection enlargement map callback (model map).

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

    - #### showLaneInfo

          void showLaneInfo(AMapLaneInfo[] laneInfos,
                            byte[] laneBackgroundInfo,
                            byte[] laneRecommendedInfo)

      已过时。 建议使用`AMapNaviListener.showLaneInfo(AMapLaneInfo)` 方法替换
      It is recommended to use `AMapNaviListener.showLaneInfo(AMapLaneInfo)` method instead
      显示道路信息回调
      Display road information callback.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `laneInfos` - 道路信息数组，可获得当前道路信息，可用于用户使用自己的素材完全自定义显示。
        Road information array, can obtain current road information, can be used for users to fully customize display with their own materials.
        `laneBackgroundInfo` - 道路背景数据数组，可用于装载官方的DriveWayView，并显示。
        Road background data array, can be used to load official DriveWayView and display.
        `laneRecommendedInfo` - 道路推荐数据数组，可用于装载官方的DriveWayView，并显示。
        Road recommended data array, can be used to load official DriveWayView and display.
      从以下版本开始:
        1.5.0

    - #### showLaneInfo

          void showLaneInfo(AMapLaneInfo laneInfo)

      显示道路信息回调
      Display road information callback.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `laneInfo` - 道路信息，可获得当前道路信息，可用于用户使用自己的素材完全自定义显示。
        Road information, can obtain current road information, can be used for users to fully customize display with their own materials.
      从以下版本开始:
        6.0.0

    - #### hideLaneInfo

          void hideLaneInfo()

      关闭道路信息回调
      Close road information callback.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      从以下版本开始:
        1.5.0

    - #### onCalculateRouteSuccess

          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
      算路成功回调
      Route calculation success callback.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `routeIds` - 路线id数组
        Route ID array
      从以下版本开始:
        5.2.0

    - #### notifyParallelRoad

          void notifyParallelRoad(int parallelRoadType)

      已过时。 已过期，请使用`ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)`
      Deprecated, please use `ParallelRoadListener.notifyParallelRoad(AMapNaviParallelRoadStatus)`
      通知当前是否显示平行路切换
      Notify whether parallel road switching is currently displayed.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `parallelRoadType` - 0表示隐藏 1 表示显示主路 2 表示显示辅路
        0 means hide, 1 means show main road, 2 means show auxiliary road
      从以下版本开始:
        1.7.0

    - #### OnUpdateTrafficFacility

          void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] infos)

      已过时。 已过期，建议使用`AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])`
      Deprecated, it is recommended to use `AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])`
      巡航模式（无路线规划）下，道路设施信息更新回调
      Road facility information update callback in cruise mode (without route planning).

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `infos` - 道路设施信息
        Road facility information
      从以下版本开始:
        1.8.0

    - #### OnUpdateTrafficFacility

          void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo)

      已过时。
      已过期，请注册并使用`AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])`
      Deprecated, please register and use `AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])`

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `aMapNaviTrafficFacilityInfo` -

    - #### updateAimlessModeCongestionInfo

          void updateAimlessModeCongestionInfo(AimLessModeCongestionInfo aimLessModeCongestionInfo)

      已过时。 已过期，建议使用`AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo)`
      Deprecated, it is recommended to use `AimlessModeListener.updateAimlessModeCongestionInfo(AimLessModeCongestionInfo)`
      巡航模式（无路线规划）下，统计信息更新回调
      Statistical information update callback in cruise mode (without route planning).

      连续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` -
      从以下版本开始:
        1.8.0

    - #### onPlayRing

          void onPlayRing(int type)

      回调各种类型的提示音，类似高德导航"叮"
      Callback for various types of prompt sounds, similar to Amap navigation "ding".

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      参数:
        `type` - 提示音类型，可以根据类型自定义播放声音
        Prompt sound type, can customize sound playback according to 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`

      从以下版本开始:
        5.5.0
      另请参阅:
        `AMapNaviRingType`

    - #### onCalculateRouteSuccess

          void onCalculateRouteSuccess(AMapCalcRouteResult routeResult)

      路线规划成功回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取
      Route planning success callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. Specific route calculation results can be obtained through `AMapCalcRouteResult`.

      可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
      Route calculation error code, route type, and route ID can be obtained through CalcRouteResult

      参数:
        `routeResult` - `AMapCalcRouteResult`
      从以下版本开始:
        6.1.0

    - #### onCalculateRouteFailure

          void onCalculateRouteFailure(AMapCalcRouteResult routeResult)

      路线规划失败回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取
      Route planning failure callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. Specific route calculation results can be obtained through `AMapCalcRouteResult`

      可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
      Route calculation error code, route type, and route ID can be obtained through CalcRouteResult

      参数:
        `routeResult` - `AMapCalcRouteResult`
      从以下版本开始:
        6.1.0

    - #### onNaviRouteNotify

          void onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)

      导航过程中道路信息通知
      Road information notification during navigation.

      注意：该接口仅驾车模式有效
      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` - 通知和避让信息，详细信息请参考`AMapNaviRouteNotifyData`
        Notification and avoidance information, please refer to `AMapNaviRouteNotifyData` for detailed information
      从以下版本开始:
        6.2.0

    - #### onGpsSignalWeak

          void onGpsSignalWeak(boolean isWeak)

      手机卫星定位信号强弱变化的回调
      Callback for changes in mobile phone satellite positioning signal strength
      参数:
        `isWeak` - true: 信号弱;false：信号强
        true: weak signal; false: strong signal
      从以下版本开始:
        7.5.0