public class AMapHudView extends FrameLayout implements AMapNaviListener
当用户点击HUD界面,会出现HUD设置栏(包括:返回按钮和镜像按钮)。
When users click on the HUD interface, the HUD settings bar will appear (including: back button and mirror button).
| 构造器和说明 |
|---|
AMapHudView(Context context) |
AMapHudView(Context context,
AttributeSet attrs) |
AMapHudView(Context context,
AttributeSet attrs,
int defStyle) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
getHudMenuEnabled()
返回 HUD设置栏是否显示
Returns whether the HUD settings bar is displayed. |
int |
getHudViewMode()
返回HUD显示模式,目前有正常、镜像两种显示模式
Returns the HUD display mode, currently with normal and mirror display modes. |
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)
通知当前是否显示平行路切换
Notify whether parallel road switching is currently displayed. |
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)
步行或者驾车路径规划失败后的回调函数
Callback function after walking or driving route planning fails. |
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)
算路成功回调
Route calculation success callback |
void |
onClick(View v) |
protected void |
onConfigurationChanged(Configuration newConfig) |
void |
onCreate(android.os.Bundle paramBundle) |
void |
onDestroy()
销毁AMapHudView
Destroy AMapHudView |
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)
导航播报信息回调函数
Navigation broadcast information callback function. |
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 |
onPause() |
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 |
onResume() |
void |
onSaveInstanceState(android.os.Bundle paramBundle) |
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 |
boolean |
onTouch(View arg0,
MotionEvent arg1) |
boolean |
onTouchHudMirrorEvent(MotionEvent event) |
void |
onTrafficStatusUpdate()
当前方路况光柱信息有更新时回调函数
Callback function when current traffic light column information is updated. |
void |
onUpdatePathSituation(AMapNaviPathSituationInfo[] pathSituationInfos)
透出施工、封路、事故等道路事件信息
|
void |
OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo)
已过期,请注册并使用
AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])Deprecated, please register and use AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])
注意:该接口仅驾车模式有效Note: This interface is only valid in driving mode |
void |
OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] infos)
巡航模式(无路线规划)下,道路设施信息更新回调
Road facility information update callback in cruise mode (without route planning). |
void |
setHudMenuEnabled(java.lang.Boolean enabled)
HUD界面是否显示设置栏
Whether the HUD interface displays the settings bar. |
void |
setHudViewListener(AMapHudViewListener listener)
设置AMapHudViewListener监听
Set AMapHudViewListener listener |
void |
setHudViewMode(int mode)
设置HUD显示模式,目前仅支持设备全屏显示
Sets the HUD display mode, currently only supports full-screen display on devices. |
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)
显示道路信息回调
Display road information callback. |
void |
showModeCross(AMapModelCross modelCross)
显示路口放大图回调(模型图)
Display intersection enlargement map callback (model map). |
void |
updateAimlessModeCongestionInfo(AimLessModeCongestionInfo aimLessModeCongestionInfo)
巡航模式(无路线规划)下,拥堵信息更新回调
Traffic jam information update callback in cruise mode (without route planning). |
void |
updateAimlessModeStatistics(AimLessModeStat aimLessModeStat)
巡航模式(无路线规划)下,统计信息更新回调
Statistical information update callback in cruise mode (without route planning). |
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 |
public AMapHudView(Context context,
AttributeSet attrs,
int defStyle)
public AMapHudView(Context context,
AttributeSet attrs)
public AMapHudView(Context context)
public int getHudViewMode()
public void setHudViewMode(int mode)
mode - HUD显示模式,包括:AMapNaviViewOptions.HUD_NORMAL_SHOW(HUD正向显示)和AMapNaviViewOptions.HUD_MIRROR_SHOW(HUD镜像显示)。
AMapNaviViewOptions.HUD_NORMAL_SHOW (HUD forward display) and AMapNaviViewOptions.HUD_MIRROR_SHOW (HUD mirror display).public boolean getHudMenuEnabled()
public void setHudMenuEnabled(java.lang.Boolean enabled)
设置栏包含返回按钮和镜像按钮。用户点击HUD界面,显示设置栏,5秒未有操作,自动隐藏。
The settings bar contains a back button and a mirror button. When the user clicks the HUD interface, the settings bar is displayed, and it automatically hides after 5 seconds without operation.
enabled - true表示当用户点击屏幕时,会显示HUD设置栏,5秒未有操作,进行隐藏。public final void onCreate(android.os.Bundle paramBundle)
public final void onResume()
public final void onPause()
public final void onSaveInstanceState(android.os.Bundle paramBundle)
public final void onDestroy()
public void setHudViewListener(AMapHudViewListener listener)
listener - AMapHudViewListener监听
public boolean onTouchHudMirrorEvent(MotionEvent event)
protected void onConfigurationChanged(Configuration newConfig)
public void onClick(View v)
public boolean onTouch(View arg0,
MotionEvent arg1)
public void onInitNaviFailure()
AMapNaviListeneronInitNaviFailure 在接口中 AMapNaviListenerpublic void onInitNaviSuccess()
AMapNaviListeneronInitNaviSuccess 在接口中 AMapNaviListenerpublic void onStartNavi(int type)
AMapNaviListeneronStartNavi 在接口中 AMapNaviListenertype - 导航类型参见NaviTypeNaviTypepublic void onTrafficStatusUpdate()
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
onTrafficStatusUpdate 在接口中 AMapNaviListenerpublic void onLocationChange(AMapNaviLocation location)
AMapNaviListeneronLocationChange 在接口中 AMapNaviListenerlocation - 当前位置的定位信息。public void onGetNavigationText(int type,
java.lang.String text)
AMapNaviListeneronGetNavigationText 在接口中 AMapNaviListenertype - 播报类型枚举,详情见 NaviTTSTypeNaviTTSTypetext - 播报文案public void onGetNavigationText(java.lang.String text)
onGetNavigationText 在接口中 AMapNaviListenertext - 播报文字。
public void onEndEmulatorNavi()
AMapNaviListeneronEndEmulatorNavi 在接口中 AMapNaviListenerpublic void onArriveDestination()
AMapNaviListeneronArriveDestination 在接口中 AMapNaviListenerpublic void onCalculateRouteFailure(int errorInfo)
AMapNaviListeneronCalculateRouteFailure 在接口中 AMapNaviListenererrorInfo - 参见PathPlanningErrCodePathPlanningErrCodepublic void onReCalculateRouteForYaw()
AMapNaviListener
此方法只是通知准备重算事件,开发者不需要在方法中触发算路逻辑,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.
onReCalculateRouteForYaw 在接口中 AMapNaviListenerpublic void onReCalculateRouteForTrafficJam()
AMapNaviListener
此方法只是通知准备重算事件,开发者不需要在方法中触发算路逻辑,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.
public void onArrivedWayPoint(int wayID)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
onArrivedWayPoint 在接口中 AMapNaviListenerwayID - 到达途径点的编号,标号从0开始,依次累加。public void onGpsOpenStatus(boolean enabled)
AMapNaviListeneronGpsOpenStatus 在接口中 AMapNaviListenerenabled - true,开启;false,未开启。public void onNaviInfoUpdate(NaviInfo naviinfo)
AMapNaviListeneronNaviInfoUpdate 在接口中 AMapNaviListenernaviinfo - 导航信息类对象。public void updateCameraInfo(AMapNaviCameraInfo[] infoArray)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
updateCameraInfo 在接口中 AMapNaviListenerinfoArray - 摄像头对象数组public void onServiceAreaUpdate(AMapServiceAreaInfo[] infoArray)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
onServiceAreaUpdate 在接口中 AMapNaviListenerinfoArray - 服务区对象数组public void showCross(AMapNaviCross aMapNaviCross)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
showCross 在接口中 AMapNaviListeneraMapNaviCross - 路口放大图类,可以获得此路口放大图bitmappublic void hideCross()
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
hideCross 在接口中 AMapNaviListenerpublic void showLaneInfo(AMapLaneInfo[] laneInfos, byte[] laneBackgroundInfo, byte[] laneRecommendedInfo)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
showLaneInfo 在接口中 AMapNaviListenerlaneInfos - 道路信息数组,可获得当前道路信息,可用于用户使用自己的素材完全自定义显示。laneBackgroundInfo - 道路背景数据数组,可用于装载官方的DriveWayView,并显示。laneRecommendedInfo - 道路推荐数据数组,可用于装载官方的DriveWayView,并显示。public void showLaneInfo(AMapLaneInfo laneInfo)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
showLaneInfo 在接口中 AMapNaviListenerlaneInfo - 道路信息,可获得当前道路信息,可用于用户使用自己的素材完全自定义显示。public void hideLaneInfo()
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
hideLaneInfo 在接口中 AMapNaviListenerpublic void onCalculateRouteSuccess(int[] routeIds)
onCalculateRouteSuccess 在接口中 AMapNaviListenerrouteIds - 路线id数组
public void notifyParallelRoad(int parallelRoadType)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
notifyParallelRoad 在接口中 AMapNaviListenerparallelRoadType - 0表示隐藏 1 表示显示主路 2 表示显示辅路public void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo)
AMapNaviListenerAimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])AimlessModeListener.onUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[])
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
OnUpdateTrafficFacility 在接口中 AMapNaviListenerpublic void onUpdatePathSituation(AMapNaviPathSituationInfo[] pathSituationInfos)
AMapNaviListeneronUpdatePathSituation 在接口中 AMapNaviListenerpathSituationInfos - 施工、封路、事故等道路事件信息public void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo[] infos)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
OnUpdateTrafficFacility 在接口中 AMapNaviListenerinfos - 道路设施信息public void updateAimlessModeStatistics(AimLessModeStat aimLessModeStat)
AMapNaviListener
连续5个点大于15km/h后开始回调。
Callback starts after 5 consecutive points greater than 15km/h.
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
updateAimlessModeStatistics 在接口中 AMapNaviListeneraimLessModeStat - 巡航模式(无路线规划)下统计信息public void updateAimlessModeCongestionInfo(AimLessModeCongestionInfo aimLessModeCongestionInfo)
AMapNaviListener
当前方无拥堵信息时,回调的AimLessModeCongestionInfo对象为空。
When there is no traffic jam information ahead, the callback AimLessModeCongestionInfo object is empty.
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
public void onPlayRing(int type)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
onPlayRing 在接口中 AMapNaviListenertype - 提示音类型,可以根据类型自定义播放声音
从5.5.0版本开始,提示音类型使用常量表示,具体类型可参考AMapNaviRingType
Starting from version 5.5.0, prompt sound types are represented by constants, specific types can be referenced in AMapNaviRingType
AMapNaviRingTypepublic void showModeCross(AMapModelCross modelCross)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
showModeCross 在接口中 AMapNaviListenermodelCross - 模型图数据类,可以获取绘制模型图需要的矢量数据public void hideModeCross()
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
hideModeCross 在接口中 AMapNaviListenerpublic void onGpsSignalWeak(boolean isWeak)
AMapNaviListeneronGpsSignalWeak 在接口中 AMapNaviListenerisWeak - true: 信号弱;false:信号强public void updateIntervalCameraInfo(AMapNaviCameraInfo startCameraInfo, AMapNaviCameraInfo endCameraInfo, int status)
AMapNaviListener
注意:该接口仅驾车模式有效
Note: This interface is only valid in driving mode
updateIntervalCameraInfo 在接口中 AMapNaviListenerstartCameraInfo - 区间测速起点信息endCameraInfo - 区间测速终点信息status - 具体类型可参考CarEnterCameraStatusCarEnterCameraStatuspublic void onCalculateRouteSuccess(AMapCalcRouteResult routeResult)
AMapNaviListenerAMapCalcRouteResult获取AMapCalcRouteResult.
可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
Route calculation error code, route type, and route ID can be obtained through CalcRouteResult
onCalculateRouteSuccess 在接口中 AMapNaviListenerrouteResult - AMapCalcRouteResultpublic void onCalculateRouteFailure(AMapCalcRouteResult routeResult)
AMapNaviListenerAMapCalcRouteResult获取AMapCalcRouteResult
可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
Route calculation error code, route type, and route ID can be obtained through CalcRouteResult
onCalculateRouteFailure 在接口中 AMapNaviListenerrouteResult - AMapCalcRouteResultpublic void onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)
AMapNaviListener
注意:该接口仅驾车模式有效
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
onNaviRouteNotify 在接口中 AMapNaviListenernotifyData - 通知和避让信息,详细信息请参考AMapNaviRouteNotifyDataAMapNaviRouteNotifyData for detailed information