com.amap.api.navi

## 类 AmapNaviParams

- java.lang.Object
- - com.amap.api.navi.AmapNaviParams

-     public class AmapNaviParams
      extends java.lang.Object

  导航组件参数类
  Navigation component parameter class

- - ### 构造器概要

    构造器
    构造器和说明
    `AmapNaviParams()`
    `AmapNaviParams(com.amap.api.maps.model.Poi end)` 构造驾车算路参数,传入终点进行算路 Construct driving route calculation parameters, pass in the destination for route calculation.
    `AmapNaviParams(com.amap.api.maps.model.Poi start, java.util.List<com.amap.api.maps.model.Poi> wayPoint, com.amap.api.maps.model.Poi end, AmapNaviType type)` 构造算路参数,可传入起点，途径点(3个)，终点，算路类型等，目前只支持驾车算路 Construct route calculation parameters, can pass in start point, waypoints (3), destination, route type, etc., currently only supports driving route calculation.
    `AmapNaviParams(com.amap.api.maps.model.Poi start, java.util.List<com.amap.api.maps.model.Poi> wayPoint, com.amap.api.maps.model.Poi end, AmapNaviType type, AmapPageType pageType)` 构造算路参数,可传入起点，途径点(3个)，终点，算路类型等，目前只支持驾车算路 Construct route calculation parameters, can pass in start point, waypoints (3), destination, route type, etc., currently only supports driving route calculation.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `AMapCarInfo` | `getCarInfo()` 获取设置的货车参数对象 Get the set truck parameter object
    `boolean` | `getIsUseInnerVoice()` 获取是否使用内部语音播报 Get whether to use internal voice broadcast 注意：6.1.0版本开始，默认值改为true Note: Starting from version 6.1.0, the default value is changed to true
    `int` | `getRouteStrategy()` 获取设置组件规划路线的策略 Get the route planning strategy set for the component
    `boolean` | `isNeedCalculateRouteWhenPresent()` 获取启动导航组件是否进行算路 Get whether to calculate route when starting navigation component
    `boolean` | `isNeedDestroyDriveManagerInstanceWhenNaviExit()` 获取退出导航组件是否销毁导航实例 Get whether to destroy navigation instance when exiting navigation component
    `boolean` | `isShowCrossImage()` 驾车导航时是否显示路口放大图 Whether to show intersection enlargement image during driving navigation
    `boolean` | `isShowExitNaviDialog()` 获取退出导航组件是否显示退出弹框 Get whether to show exit dialog when exiting navigation component
    `boolean` | `isShowRouteStrategyPreferenceView()` 设置路径规划偏好策略页面是否显示 Set whether the route planning preference strategy page is displayed
    `boolean` | `isTrafficEnabled()` 导航组件路况开关是否打开 Whether the navigation component traffic condition switch is turned on
    `AmapNaviParams` | `setBroadcastMode(Context context, int mode)` 设置播报模式 Set broadcast mode
    `AmapNaviParams` | `setCarDirectionMode(Context context, int mode)` 设置导航视角 Set navigation perspective
    `AmapNaviParams` | `setCarInfo(AMapCarInfo carInfo)` 设置车辆信息，进行尾号限行与货车导航 Set vehicle information for tail number restriction and truck navigation
    `AmapNaviParams` | `setDayAndNightMode(Context context, int mode)` 设置导航页面昼夜模式 Set day and night mode for navigation page
    `AmapNaviParams` | `setMultipleRouteNaviMode(boolean multipleRouteNaviMode)` 设置多路线导航模式(导航中拥有若干条备选路线供用户选择), 或单路线导航模式(默认模式) Set multi-route navigation mode (navigation with several alternative routes for user selection), or single-route navigation mode (default mode).
    `AmapNaviParams` | `setNaviMode(int naviType)` 设置直接导航模式（仅在使用组件直接导航（不调起算路页面）时生效） Set direct navigation mode (only effective when using component direct navigation (without calling up the route calculation page))
    `AmapNaviParams` | `setNeedCalculateRouteWhenPresent(boolean needCalculateRouteWhenPresent)` 启动组件进行直接导航时，设置是否进行算路 (只有在直接跳转导航页的情况下才生效) When starting the component for direct navigation, set whether to calculate the route (only effective when directly jumping to the navigation page)
    `AmapNaviParams` | `setNeedDestroyDriveManagerInstanceWhenNaviExit(boolean destroy)` 设置退出导航组件是否销毁导航实例 Set whether to destroy navigation instance when exiting navigation component
    `AmapNaviParams` | `setRouteStrategy(int routeStrategy)` 设置组件规划路线的策略，默认为`PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT`，速度优先+躲避拥堵+距离较短 Set the route planning strategy for the component, default is `PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT`, speed priority + avoid congestion + shorter distance
    `AmapNaviParams` | `setScaleAutoChangeEnable(Context context, boolean enable)` 设置比例尺智能缩放是否开启 Set whether scale intelligent zoom is enabled
    `AmapNaviParams` | `setSecondActionVisible(boolean visible)` 设置组件导航页是否显示下下个路口引导，默认不显示 Set whether the component navigation page shows guidance for the next-next intersection, default is not displayed.
    `AmapNaviParams` | `setShowCrossImage(boolean showCrossImage)` 设置驾车导航时是否显示路口放大图 Set whether to show intersection enlargement image during driving navigation
    `AmapNaviParams` | `setShowExitNaviDialog(boolean showExitNaviDialog)` 设置退出导航组件是否显示退出弹框 Set whether to show exit dialog when exiting navigation component
    `AmapNaviParams` | `setShowRouteStrategyPreferenceView(boolean showRouteStrategyPreferenceView)` 表示设置路径规划偏好策略页面是否显示 Indicates whether the route planning preference strategy page is displayed
    `AmapNaviParams` | `setShowVoiceSetings(boolean showVoiceAssistEnable)` 设置是否展示导航语音播报设置项 Set whether to show navigation voice broadcast settings
    `AmapNaviParams` | `setTheme(AmapNaviTheme theme)` 设置组件主题 Set component theme.
    `AmapNaviParams` | `setTrafficEnabled(boolean enable)` 导航组件路况开关是否打开 Whether the navigation component traffic condition switch is turned on
    `AmapNaviParams` | `setTruckMultipleRouteNaviMode(boolean truckMultipleRouteNaviMode)` 设置货车多路线导航模式(导航中拥有若干条备选路线供用户选择), 或单路线导航模式（默认模式） Set truck multi-route navigation mode (navigation with several alternative routes for user selection), or single-route navigation mode (default mode).
    `AmapNaviParams` | `setUseInnerVoice(boolean isUseInnerVoice)` 设置是否使用内部语音播报 Set whether to use internal voice broadcast
    `AmapNaviParams` | `showEagleMap(Context context, boolean showEagleMap)`
    `boolean` | `showVoiceAssistEnable()` 是否展示导航语音播报设置项 Whether to show navigation voice broadcast settings

    - ### 从类继承的方法 java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### AmapNaviParams

          public AmapNaviParams()

    - #### AmapNaviParams

          public AmapNaviParams(com.amap.api.maps.model.Poi end)

      构造驾车算路参数,传入终点进行算路
      Construct driving route calculation parameters, pass in the destination for route calculation.
      参数:
        `end` - 终点坐标
        Destination coordinates
      从以下版本开始:
        5.2.0

    - #### AmapNaviParams

          public AmapNaviParams(com.amap.api.maps.model.Poi start,
                                java.util.List<com.amap.api.maps.model.Poi> wayPoint,
                                com.amap.api.maps.model.Poi end,
                                AmapNaviType type)

      构造算路参数,可传入起点，途径点(3个)，终点，算路类型等，目前只支持驾车算路
      Construct route calculation parameters, can pass in start point, waypoints (3), destination, route type, etc., currently only supports driving route calculation.
      参数:
        `start` - 起点坐标
        Starting point coordinates
        `wayPoint` - 途径点坐标集合，最多3个途径点
        Waypoint coordinate collection, up to 3 waypoints
        `end` - 终点坐标
        Destination coordinates
        `type` - 算路类型。目前只开放驾车，参考`AmapNaviType`
        Route calculation type. Currently only driving is open, refer to `AmapNaviType`
      从以下版本开始:
        5.3.0

    - #### AmapNaviParams

          public AmapNaviParams(com.amap.api.maps.model.Poi start,
                                java.util.List<com.amap.api.maps.model.Poi> wayPoint,
                                com.amap.api.maps.model.Poi end,
                                AmapNaviType type,
                                AmapPageType pageType)

      构造算路参数,可传入起点，途径点(3个)，终点，算路类型等，目前只支持驾车算路
      Construct route calculation parameters, can pass in start point, waypoints (3), destination, route type, etc., currently only supports driving route calculation.
      参数:
        `start` - 起点坐标
        Starting point coordinates
        `wayPoint` - 途径点坐标集合，最多3个途径点
        Waypoint coordinate collection, up to 3 waypoints
        `end` - 终点坐标
        Destination coordinates
        `type` - 算路类型。目前只开放驾车，参考`AmapNaviType`
        Route calculation type. Currently only driving is open, refer to `AmapNaviType`
        `pageType` - 页面类型，可选择是跳转到规划页还是导航页,枚举参考`AmapPageType`
        Page type, can choose to jump to planning page or navigation page, enumeration reference `AmapPageType`
      从以下版本开始:
        5.3.0

  - ### 方法详细资料

    - #### setNaviMode

          public AmapNaviParams setNaviMode(int naviType)

      设置直接导航模式（仅在使用组件直接导航（不调起算路页面）时生效）
      Set direct navigation mode (only effective when using component direct navigation (without calling up the route calculation page))
      参数:
        `naviType` - 1-实时导航 2-模拟导航
        1-real-time navigation 2-simulated navigation
      返回:
      从以下版本开始:
        7.5.0

    - #### setTheme

          public AmapNaviParams setTheme(AmapNaviTheme theme)

      设置组件主题
      Set component theme.

      目前支持的的主题有三种：
      Currently supported themes are three:
      蓝色(默认主题):`AmapNaviTheme.BLUE`
      Blue (default theme):`AmapNaviTheme.BLUE`
      白色:`AmapNaviTheme.WHITE`
      White:`AmapNaviTheme.WHITE`
      黑色:`AmapNaviTheme.BLACK`
      Black:`AmapNaviTheme.BLACK`

      参数:
        `theme` -
      返回:
      从以下版本开始:
        5.5.0

    - #### isNeedCalculateRouteWhenPresent

          public boolean isNeedCalculateRouteWhenPresent()

      获取启动导航组件是否进行算路
      Get whether to calculate route when starting navigation component
      返回:

    - #### setNeedCalculateRouteWhenPresent

          public AmapNaviParams setNeedCalculateRouteWhenPresent(boolean needCalculateRouteWhenPresent)

      启动组件进行直接导航时，设置是否进行算路 (只有在直接跳转导航页的情况下才生效)
      When starting the component for direct navigation, set whether to calculate the route (only effective when directly jumping to the navigation page)
      参数:
        `needCalculateRouteWhenPresent` - true : 算路，false : 启动组件以后不会算路直接开启导航。默认为true。
        true : Calculate route, false : Component will not calculate route and directly start navigation after startup. Default is true.
      从以下版本开始:
        5.6.0

    - #### isNeedDestroyDriveManagerInstanceWhenNaviExit

          public boolean isNeedDestroyDriveManagerInstanceWhenNaviExit()

      获取退出导航组件是否销毁导航实例
      Get whether to destroy navigation instance when exiting navigation component
      返回:
        若为true，则退出导航页时停止导航，退出组件时销毁导航
        If true, stop navigation when exiting navigation page, destroy navigation when exiting component
      从以下版本开始:
        5.6.0

    - #### setNeedDestroyDriveManagerInstanceWhenNaviExit

          public AmapNaviParams setNeedDestroyDriveManagerInstanceWhenNaviExit(boolean destroy)

      设置退出导航组件是否销毁导航实例
      Set whether to destroy navigation instance when exiting navigation component
      参数:
        `destroy` - true-退出导航页时停止导航，退出组件时销毁导航
        false-退出组件不会销毁导航；当使用组件直接导航时，退出导航页也不会停止导航
        true-Stop navigation when exiting navigation page, destroy navigation when exiting component
        false-Do not destroy navigation when exiting component; when using component direct navigation, do not stop navigation when exiting navigation page
      从以下版本开始:
        5.6.0

    - #### isShowExitNaviDialog

          public boolean isShowExitNaviDialog()

      获取退出导航组件是否显示退出弹框
      Get whether to show exit dialog when exiting navigation component
      返回:
      从以下版本开始:
        5.6.0

    - #### setShowExitNaviDialog

          public AmapNaviParams setShowExitNaviDialog(boolean showExitNaviDialog)

      设置退出导航组件是否显示退出弹框
      Set whether to show exit dialog when exiting navigation component
      参数:
        `showExitNaviDialog` -
      从以下版本开始:
        6.0.0

    - #### getCarInfo

          public AMapCarInfo getCarInfo()

      获取设置的货车参数对象
      Get the set truck parameter object
      返回:
      从以下版本开始:
        6.0.0

    - #### setCarInfo

          public AmapNaviParams setCarInfo(AMapCarInfo carInfo)

      设置车辆信息，进行尾号限行与货车导航
      Set vehicle information for tail number restriction and truck navigation
      参数:
        `carInfo` - `AMapCarInfo`
      从以下版本开始:
        6.0.0

    - #### setUseInnerVoice

          public AmapNaviParams setUseInnerVoice(boolean isUseInnerVoice)

      设置是否使用内部语音播报
      Set whether to use internal voice broadcast
      参数:
        `isUseInnerVoice` - 是否使用内部语音播报
        Whether to use internal voice broadcast
        注意：6.1.0版本开始，默认值改为true
        Note: Starting from version 6.1.0, the default value is changed to true
      从以下版本开始:
        6.0.0

    - #### getIsUseInnerVoice

          public boolean getIsUseInnerVoice()

      获取是否使用内部语音播报
      Get whether to use internal voice broadcast
      注意：6.1.0版本开始，默认值改为true
      Note: Starting from version 6.1.0, the default value is changed to true
      返回:
      从以下版本开始:
        6.0.0

    - #### getRouteStrategy

          public int getRouteStrategy()

      获取设置组件规划路线的策略
      Get the route planning strategy set for the component
      返回:

    - #### setRouteStrategy

          public AmapNaviParams setRouteStrategy(int routeStrategy)

      设置组件规划路线的策略，默认为`PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT`，速度优先+躲避拥堵+距离较短
      Set the route planning strategy for the component, default is `PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT`, speed priority + avoid congestion + shorter distance
      参数:
        `routeStrategy` - `PathPlanningStrategy`

    - #### isShowCrossImage

          public boolean isShowCrossImage()

      驾车导航时是否显示路口放大图
      Whether to show intersection enlargement image during driving navigation
      返回:

    - #### setShowCrossImage

          public AmapNaviParams setShowCrossImage(boolean showCrossImage)

      设置驾车导航时是否显示路口放大图
      Set whether to show intersection enlargement image during driving navigation
      参数:
        `showCrossImage` -

    - #### isShowRouteStrategyPreferenceView

          public boolean isShowRouteStrategyPreferenceView()

      设置路径规划偏好策略页面是否显示
      Set whether the route planning preference strategy page is displayed
      返回:

    - #### setShowRouteStrategyPreferenceView

          public AmapNaviParams setShowRouteStrategyPreferenceView(boolean showRouteStrategyPreferenceView)

      表示设置路径规划偏好策略页面是否显示
      Indicates whether the route planning preference strategy page is displayed
      参数:
        `showRouteStrategyPreferenceView` -

    - #### setTrafficEnabled

          public AmapNaviParams setTrafficEnabled(boolean enable)

      导航组件路况开关是否打开
      Whether the navigation component traffic condition switch is turned on
      参数:
        `enable` - 默认为false
        Default is false
      从以下版本开始:
        6.2.0

    - #### isTrafficEnabled

          public boolean isTrafficEnabled()

      导航组件路况开关是否打开
      Whether the navigation component traffic condition switch is turned on
      从以下版本开始:
        6.2.0

    - #### setMultipleRouteNaviMode

          public AmapNaviParams setMultipleRouteNaviMode(boolean multipleRouteNaviMode)

      设置多路线导航模式(导航中拥有若干条备选路线供用户选择), 或单路线导航模式(默认模式)
      Set multi-route navigation mode (navigation with several alternative routes for user selection), or single-route navigation mode (default mode).

      注意:此方法仅限于在开始导航前调用有效,步行与骑行导航无效，以下情况不会出现多备选路线：
      Note: This method is only valid when called before starting navigation, walking and cycling navigation are invalid, multiple alternative routes will not appear in the following situations:
      货车导航、路线存在途经点、路线长度超过80KM。
      Truck navigation, route has waypoints, route length exceeds 80KM.

      参数:
        `multipleRouteNaviMode` - true:多路线导航模式, false:单路线导航模式 默认为true
        true: Multi-route navigation mode, false: Single-route navigation mode, default is true
      从以下版本开始:
        6.3.0

    - #### setTruckMultipleRouteNaviMode

          public AmapNaviParams setTruckMultipleRouteNaviMode(boolean truckMultipleRouteNaviMode)

      设置货车多路线导航模式(导航中拥有若干条备选路线供用户选择), 或单路线导航模式（默认模式）
      Set truck multi-route navigation mode (navigation with several alternative routes for user selection), or single-route navigation mode (default mode).

      注意：此方法仅限于在开始导航前调用有效，步行与骑行导航无效，以下情况不会出现多备选路线：模拟导航、路线存在途经点、路线长度超过80KM。
      Note: This method is only valid when called before starting navigation, walking and cycling navigation are invalid, multiple alternative routes will not appear in the following situations: simulated navigation, route has waypoints, route length exceeds 80KM.
      特别注意：当前接口为收费接口，您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/
      Special note: This interface is a paid interface. If you apply for trial or formal application, please submit a business cooperation ticket through the ticket system for communication https://lbs.amap.com/

      参数:
        `truckMultipleRouteNaviMode` - true:多路线导航模式，false:单路线导航模式（默认）
        true: Multi-route navigation mode, false: Single-route navigation mode (default)
      从以下版本开始:
        9.3.5

    - #### setSecondActionVisible

          public AmapNaviParams setSecondActionVisible(boolean visible)

      设置组件导航页是否显示下下个路口引导，默认不显示
      Set whether the component navigation page shows guidance for the next-next intersection, default is not displayed.

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

      参数:
        `visible` - true-显示，false-隐藏
        true-show, false-hide
      从以下版本开始:
        6.9.0

    - #### setDayAndNightMode

          public AmapNaviParams setDayAndNightMode(Context context,
                                                   int mode)

      设置导航页面昼夜模式
      Set day and night mode for navigation page
      参数:
        `mode` - 0-自动切换 1-白天 2-夜间
        0-auto switch 1-day 2-night
      从以下版本开始:
        7.1.0

    - #### setBroadcastMode

          public AmapNaviParams setBroadcastMode(Context context,
                                                 int mode)

      设置播报模式
      Set broadcast mode
      参数:
        `context` -
        `mode` - 1-简洁播报 2-详细播报 3-静音模式
        1-concise broadcast 2-detailed broadcast 3-mute mode
      从以下版本开始:
        7.1.0

    - #### setCarDirectionMode

          public AmapNaviParams setCarDirectionMode(Context context,
                                                    int mode)

      设置导航视角
      Set navigation perspective
      参数:
        `context` -
        `mode` - 1-正北向上 2-车头向上
        1-north up 2-vehicle heading up
      从以下版本开始:
        7.1.0

    - #### setScaleAutoChangeEnable

          public AmapNaviParams setScaleAutoChangeEnable(Context context,
                                                         boolean enable)

      设置比例尺智能缩放是否开启
      Set whether scale intelligent zoom is enabled
      参数:
        `context` -
        `enable` -
      从以下版本开始:
        7.1.0

    - #### showVoiceAssistEnable

          public boolean showVoiceAssistEnable()

      是否展示导航语音播报设置项
      Whether to show navigation voice broadcast settings
      返回:
      从以下版本开始:
        8.0.1

    - #### setShowVoiceSetings

          public AmapNaviParams setShowVoiceSetings(boolean showVoiceAssistEnable)

      设置是否展示导航语音播报设置项
      Set whether to show navigation voice broadcast settings
      返回:
      从以下版本开始:
        8.0.1

    - #### showEagleMap

          public AmapNaviParams showEagleMap(Context context,
                                             boolean showEagleMap)