public class AMapNaviView
extends FrameLayout
限定符和类型 | 字段和说明 |
---|---|
static int |
CAR_UP_MODE
0-车头向上模式
|
static int |
NORTH_UP_MODE
1-正北向上模式,步行和骑行导航如果打开了sensor,此模式将无效。
|
构造器和说明 |
---|
AMapNaviView(Context context,
AMapNaviViewOptions options)
根据给定的参数构造一个导航视图类对象。
|
限定符和类型 | 方法和说明 |
---|---|
void |
displayOverview()
已过时。
|
double |
getAnchorX()
获取当前锁车态下,自车位置锁定在屏幕x轴的位置比率,范围:0-1,0代表最左侧,1代表最右侧
|
double |
getAnchorY()
获取当前锁车态下,自车位置锁定在屏幕y轴的位置比率,范围:0-1,0代表最顶端,1代表最底部
|
int |
getLockTilt()
已过时。
|
int |
getLockZoom()
已过时。
|
com.amap.api.maps.AMap |
getMap()
获取地图控制类
|
int |
getNaviMode()
获取导航模式
|
AMapNaviViewOptions |
getViewOptions()
返回导航自定义视图的属性配置对象。
|
boolean |
isAutoChangeZoom()
|
boolean |
isOrientationLandscape()
返回当前屏幕的横竖屏状态
|
boolean |
isRouteOverviewNow()
是否是路线全览模式
|
boolean |
isShowRoadEnlarge()
当前是否正在显示路口放大图
|
boolean |
isTrafficLine()
已过时。
|
void |
onCreate(Bundle bundle)
与Activity onCreate同步
|
void |
onDestroy()
与Activity onDestroy同步
在1.6.0之前,此方法会自动执行AMapNavi.stopNavi(); 在1.6.0之后(包括1.6.0),请用户自己根据需要选择执行AMapNavi.stopNavi();
|
void |
onPause()
与Activity onPause同步
|
void |
onResume()
与Activity onResume同步
|
void |
onSaveInstanceState(Bundle paramBundle)
与Activity onSaveInstanceState同步
|
void |
recoverLockMode()
已过时。
|
void |
reInit(Bundle bundle)
|
void |
setAMapNaviViewListener(AMapNaviViewListener aMapNaviSettingListener)
设置自定义导航界面的事件回调监听
|
void |
setCarOverlayVisible(boolean isVisible)
设置是否隐藏自定义导航view上的车标,包括自车、罗盘、牵引线
|
boolean |
setCommonOverlayData(java.lang.String data)
设置外部通用点线面数据
|
void |
setLazyDirectionView(DirectionView lazyDirectionView)
设置自定义的指南针视图
|
void |
setLazyDriveWayView(DriveWayView lazyDriveWayView)
设置自定义的车道线视图
|
void |
setLazyNextTurnTipView(NextTurnTipView lazyNextTurnTipView)
设置自定义的转向图标
|
void |
setLazyOverviewButtonView(OverviewButtonView lazyOverviewButtonView)
设置用户自定义的全览按钮
|
void |
setLazyTrafficButtonView(TrafficButtonView lazyTrafficButtonView)
设置自定义的路况按钮视图
|
void |
setLazyTrafficProgressBarView(TrafficProgressBar lazyTrafficProgressBarView)
设置用户自定义的导航光柱条View
设置自定义的光柱条view,只需要设置位置和宽、高即可,颜色车标等元素,导航SDK内部会帮助进行更新操作。 |
void |
setLazyZoomButtonView(ZoomButtonView zoomButtonView)
设置自定义的地图缩放按钮
|
void |
setLazyZoomInIntersectionView(ZoomInIntersectionView zoomInIntersectionView)
设置自定义的路口放大图
|
void |
setLockTilt(int lockTilt)
已过时。
|
void |
setLockZoom(int lockZoom)
已过时。
|
void |
setNaviMode(int mode)
设置导航模式
|
void |
setOnCameraChangeListener(com.amap.api.maps.AMap.OnCameraChangeListener cameraChangeListener)
设置自定义导航view中地图的视角变化事件监听
|
void |
setOnMapLoadedListener(com.amap.api.maps.AMap.OnMapLoadedListener loadListener)
设置自定义导航view中地图的加载完成事件监听
|
void |
setOnMapTouchListener(com.amap.api.maps.AMap.OnMapTouchListener mapTouchListener)
设置自定义导航view中地图的点击事件监听
|
void |
setOnMarkerClickListener(com.amap.api.maps.AMap.OnMarkerClickListener listener)
设置marker点击事件
|
void |
setOnPolylineClickListener(com.amap.api.maps.AMap.OnPolylineClickListener listener)
设置polyline点击事件
|
void |
setRouteMarkerVisible(boolean showStartEndVia,
boolean showFootFerry,
boolean showForbidden)
已过时。
|
void |
setRouteMarkerVisible(boolean showStartEndVia,
boolean showFootFerry,
boolean showForbidden,
boolean showRouteStartIcon,
boolean showRouteEndIcon)
是否显示 起终途点\步行轮渡扎点\禁行限行封路icon\路线起点icon\路线终点icon
|
void |
setShowDriveCongestion(boolean showDriveCongestion)
是否显示拥堵气泡
|
void |
setShowMode(int showMode)
设置导航页面显示模式
|
void |
setShowTrafficLightView(boolean showTrafficLightView)
是否显示红绿灯倒计时气泡
|
void |
setTMCRouteColor(int defaultColor,
int smoothColor,
int slowColor,
int jamColor,
int seriousJamColor,
int verysmoothColor)
设置光柱图的路口颜色
|
void |
setTMCRouteLayout(int left,
int top,
int width,
int height)
设置光柱图的位置
|
void |
setTrafficLightsVisible(boolean isVisible)
设置是否显示路线上的交通信号灯
|
void |
setTrafficLine(boolean isTrafficEnable)
|
void |
setViewOptions(AMapNaviViewOptions options)
设置导航自定义视图界面的属性配置对象,用于控制导航地图的仰角,是否展示车道信息,是否显示路况放大图等属性
|
void |
zoomIn()
扩大一级当前地图缩放级别
|
void |
zoomOut()
缩小一级当前地图缩放级别
|
public static final int CAR_UP_MODE
public static final int NORTH_UP_MODE
public AMapNaviView(Context context, AMapNaviViewOptions options)
context
- 指定的Context对象。options
- 指定的视图属性配置对象。public void reInit(Bundle bundle)
public double getAnchorX()
public double getAnchorY()
public int getLockZoom()
AMapNaviViewOptions.getZoom()
public void setLockZoom(int lockZoom)
AMapNaviViewOptions.setZoom(int)
lockZoom
- 锁车缩放级别public int getLockTilt()
AMapNaviViewOptions.getTilt()
public void setLockTilt(int lockTilt)
AMapNaviViewOptions.setTilt(int)
lockTilt
- 地图倾斜角度public int getNaviMode()
public void setNaviMode(int mode)
mode
- 导航模式 0-CAR_UP_MODE 1-NORTH_UP_MODEpublic boolean isAutoChangeZoom()
public AMapNaviViewOptions getViewOptions()
public void setViewOptions(AMapNaviViewOptions options)
options
- 指定的导航视图属性配置对象public com.amap.api.maps.AMap getMap()
public final void onCreate(Bundle bundle)
bundle
- public final void onResume()
public final void onPause()
public final void onDestroy()
public final void onSaveInstanceState(Bundle paramBundle)
paramBundle
- public void displayOverview()
AMapNaviView.setShowMode(int)
public void recoverLockMode()
AMapNaviView.setShowMode(int)
public void setShowMode(int showMode)
showMode
- 1-锁车态 2-全览态 3-普通态public boolean isTrafficLine()
AMapNaviViewOptions.isTrafficLine()
public void setTrafficLine(boolean isTrafficEnable)
isTrafficEnable
- 实时路况状态public void setAMapNaviViewListener(AMapNaviViewListener aMapNaviSettingListener)
aMapNaviSettingListener
- 界面事件回调监听器public boolean isShowRoadEnlarge()
public boolean isOrientationLandscape()
public void setLazyDriveWayView(DriveWayView lazyDriveWayView)
lazyDriveWayView
- public void setLazyZoomInIntersectionView(ZoomInIntersectionView zoomInIntersectionView)
zoomInIntersectionView
- public void setLazyDirectionView(DirectionView lazyDirectionView)
lazyDirectionView
- public void setLazyTrafficButtonView(TrafficButtonView lazyTrafficButtonView)
lazyTrafficButtonView
- public void setLazyNextTurnTipView(NextTurnTipView lazyNextTurnTipView)
lazyNextTurnTipView
- public void setLazyZoomButtonView(ZoomButtonView zoomButtonView)
zoomButtonView
- public void setLazyOverviewButtonView(OverviewButtonView lazyOverviewButtonView)
lazyOverviewButtonView
- public void setLazyTrafficProgressBarView(TrafficProgressBar lazyTrafficProgressBarView)
lazyTrafficProgressBarView
- public void zoomIn()
public void zoomOut()
public boolean isRouteOverviewNow()
public void setOnMapLoadedListener(com.amap.api.maps.AMap.OnMapLoadedListener loadListener)
loadListener
- OnMapLoadedListener监听public void setOnCameraChangeListener(com.amap.api.maps.AMap.OnCameraChangeListener cameraChangeListener)
cameraChangeListener
- OnCameraChangeListener监听public void setOnMapTouchListener(com.amap.api.maps.AMap.OnMapTouchListener mapTouchListener)
mapTouchListener
- OnMapTouchListener监听public void setCarOverlayVisible(boolean isVisible)
isVisible
- true-显示 false-不显示, 默认为显示public void setTrafficLightsVisible(boolean isVisible)
isVisible
- true 显示 false 不显示 默认为显示@Deprecated public void setRouteMarkerVisible(boolean showStartEndVia, boolean showFootFerry, boolean showForbidden)
showStartEndVia
- 是否显示起终途点showFootFerry
- 是否显示步行轮渡扎点showForbidden
- 是否显示禁行限行图标public void setRouteMarkerVisible(boolean showStartEndVia, boolean showFootFerry, boolean showForbidden, boolean showRouteStartIcon, boolean showRouteEndIcon)
showStartEndVia
- 是否显示起终途点showFootFerry
- 是否显示步行轮渡扎点showForbidden
- 是否显示禁行限行图标showRouteStartIcon
- 是否显示路线期起点IconshowRouteEndIcon
- 是否显示路线期终点Iconpublic void setOnMarkerClickListener(com.amap.api.maps.AMap.OnMarkerClickListener listener)
listener
- public void setOnPolylineClickListener(com.amap.api.maps.AMap.OnPolylineClickListener listener)
listener
- public void setTMCRouteLayout(int left, int top, int width, int height)
left
- top
- width
- height
- public void setTMCRouteColor(int defaultColor, int smoothColor, int slowColor, int jamColor, int seriousJamColor, int verysmoothColor)
defaultColor
- 交通状况默认smoothColor
- 交通状况情况良好slowColor
- 交通状况迟缓jamColor
- 交通状况拥堵seriousJamColor
- 交通状况严重拥堵verysmoothColor
- 交通状况情况非常通畅public boolean setCommonOverlayData(java.lang.String data)
data
- * @return true设置成功,false设置失败public void setShowDriveCongestion(boolean showDriveCongestion)
showDriveCongestion
- public void setShowTrafficLightView(boolean showTrafficLightView)
showTrafficLightView
-