public class AmapNaviParams
extends java.lang.Object
| 构造器和说明 |
|---|
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 |
public AmapNaviParams()
public AmapNaviParams(com.amap.api.maps.model.Poi end)
end - 终点坐标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)
start - 起点坐标wayPoint - 途径点坐标集合,最多3个途径点end - 终点坐标type - 算路类型。目前只开放驾车,参考AmapNaviTypeAmapNaviTypepublic 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)
start - 起点坐标wayPoint - 途径点坐标集合,最多3个途径点end - 终点坐标type - 算路类型。目前只开放驾车,参考AmapNaviTypeAmapNaviTypepageType - 页面类型,可选择是跳转到规划页还是导航页,枚举参考AmapPageTypeAmapPageTypepublic AmapNaviParams setNaviMode(int naviType)
naviType - 1-实时导航 2-模拟导航public AmapNaviParams setTheme(AmapNaviTheme theme)
目前支持的的主题有三种:
Currently supported themes are three:
蓝色(默认主题):AmapNaviTheme.BLUE
Blue (default theme):AmapNaviTheme.BLUE
白色:AmapNaviTheme.WHITE
White:AmapNaviTheme.WHITE
黑色:AmapNaviTheme.BLACK
Black:AmapNaviTheme.BLACK
theme - public boolean isNeedCalculateRouteWhenPresent()
public AmapNaviParams setNeedCalculateRouteWhenPresent(boolean needCalculateRouteWhenPresent)
needCalculateRouteWhenPresent - true : 算路,false : 启动组件以后不会算路直接开启导航。默认为true。public boolean isNeedDestroyDriveManagerInstanceWhenNaviExit()
public AmapNaviParams setNeedDestroyDriveManagerInstanceWhenNaviExit(boolean destroy)
destroy - true-退出导航页时停止导航,退出组件时销毁导航public boolean isShowExitNaviDialog()
public AmapNaviParams setShowExitNaviDialog(boolean showExitNaviDialog)
showExitNaviDialog - public AMapCarInfo getCarInfo()
public AmapNaviParams setCarInfo(AMapCarInfo carInfo)
carInfo - AMapCarInfopublic AmapNaviParams setUseInnerVoice(boolean isUseInnerVoice)
isUseInnerVoice - 是否使用内部语音播报public boolean getIsUseInnerVoice()
public int getRouteStrategy()
public AmapNaviParams setRouteStrategy(int routeStrategy)
PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT,速度优先+躲避拥堵+距离较短PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT, speed priority + avoid congestion + shorter distancerouteStrategy - PathPlanningStrategypublic boolean isShowCrossImage()
public AmapNaviParams setShowCrossImage(boolean showCrossImage)
showCrossImage - public boolean isShowRouteStrategyPreferenceView()
public AmapNaviParams setShowRouteStrategyPreferenceView(boolean showRouteStrategyPreferenceView)
showRouteStrategyPreferenceView - public AmapNaviParams setTrafficEnabled(boolean enable)
enable - 默认为falsepublic boolean isTrafficEnabled()
public AmapNaviParams setMultipleRouteNaviMode(boolean multipleRouteNaviMode)
注意:此方法仅限于在开始导航前调用有效,步行与骑行导航无效,以下情况不会出现多备选路线:
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:单路线导航模式 默认为truepublic AmapNaviParams setTruckMultipleRouteNaviMode(boolean truckMultipleRouteNaviMode)
注意:此方法仅限于在开始导航前调用有效,步行与骑行导航无效,以下情况不会出现多备选路线:模拟导航、路线存在途经点、路线长度超过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:单路线导航模式(默认)public AmapNaviParams setSecondActionVisible(boolean visible)
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
visible - true-显示,false-隐藏public AmapNaviParams setDayAndNightMode(Context context, int mode)
mode - 0-自动切换 1-白天 2-夜间public AmapNaviParams setBroadcastMode(Context context, int mode)
context - mode - 1-简洁播报 2-详细播报 3-静音模式public AmapNaviParams setCarDirectionMode(Context context, int mode)
context - mode - 1-正北向上 2-车头向上public AmapNaviParams setScaleAutoChangeEnable(Context context, boolean enable)
context - enable - public boolean showVoiceAssistEnable()
public AmapNaviParams setShowVoiceSetings(boolean showVoiceAssistEnable)
public AmapNaviParams showEagleMap(Context context, boolean showEagleMap)