高德地图SDK(导航)  V7.7.0
AMapNaviDriveView.h
Go to the documentation of this file.
1 //
2 // AMapNaviDriveView.h
3 // AMapNaviKit
4 //
5 // Created by AutoNavi on 15/12/28.
6 // Copyright © 2016年 Amap. All rights reserved.
7 //
8 
10 #import "AMapNaviCommonObj.h"
13 
14 NS_ASSUME_NONNULL_BEGIN
15 
17 
20 
21 #pragma mark - Delegate
22 
24 @property (nonatomic, weak) id<AMapNaviDriveViewDelegate> delegate;
25 
27 @property (nonatomic, weak) id <MAMapViewDelegate> mapViewDelegate;
28 
29 #pragma mark - Mode Options
30 
32 @property (nonatomic, assign) AMapNaviViewTrackingMode trackingMode;
33 
35 @property (nonatomic, assign) AMapNaviDriveViewShowMode showMode;
36 
37 #pragma mark - Map Options
38 
40 @property (nonatomic, assign) CGPoint logoCenter;
41 
43 @property (nonatomic, assign, readonly) CGSize logoSize;
44 
46 @property (nonatomic, assign) BOOL showScale;
47 
49 @property (nonatomic, assign) CGPoint scaleOrigin;
50 
52 @property (nonatomic, assign) BOOL showCompass;
53 
55 @property (nonatomic, assign) CGPoint compassOrigin;
56 
58 @property (nonatomic, assign, readonly) CGSize compassSize;
59 
61 @property (nonatomic, assign) BOOL mapShowTraffic;
62 
64 @property (nonatomic, assign) CGFloat mapZoomLevel;
65 
67 @property (nonatomic, assign) BOOL autoZoomMapLevel;
68 
70 @property (nonatomic, assign) CGFloat cameraDegree;
71 
73 @property (nonatomic, assign) CGPoint screenAnchor;
74 
76 @property (nonatomic, assign) NSUInteger maxRenderFrame;
77 
79 @property (nonatomic, assign) AMapNaviViewMapModeType mapViewModeType;
80 
85 - (void)setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions;
86 
88 @property (nonatomic, assign) BOOL autoSwitchDayNightType __attribute((deprecated("已废弃, 请使用 mapViewModeType 替代 since 6.7.0")));
89 
91 @property (nonatomic, assign) BOOL showStandardNightType __attribute((deprecated("已废弃, 请使用 mapViewModeType 替代 since 6.7.0")));
92 
94 @property (nonatomic, assign) BOOL customMapStyleEnabled __attribute((deprecated("已废弃, 请使用 mapViewModeType 替代 since 6.7.0")));
95 
100 - (void)setCustomMapStyle:(NSData *)customJson __attribute((deprecated("已废弃, 请使用 setCustomMapStyleOptions: 替代 since 6.6.0")));
101 
106 - (void)setCustomMapStyleWithWebData:(NSData*)data __attribute((deprecated("已废弃, 请使用 setCustomMapStyleOptions: 替代 since 6.6.0")));
107 
108 #pragma mark - Annoation Options and Overlay Options
109 
111 @property (nonatomic, assign) BOOL showTrafficLayer __attribute((deprecated("已废弃, 请使用 mapShowTraffic 结合 -statusTextures: 替代. since 7.4.0")));
112 
114 @property (nonatomic, assign) BOOL showCamera;
115 
117 @property (nonatomic, assign) BOOL showTurnArrow;
118 
120 @property (nonatomic, strong) UIColor *turnArrowColor;
121 
123 @property (nonatomic, assign) CGFloat turnArrowWidth;
124 
126 @property (nonatomic, assign) BOOL turnArrowIs3D;
127 
129 @property (nonatomic, strong) UIColor *turnArrowSideColor;
130 
132 @property (nonatomic, assign) BOOL showVectorline;
133 
135 @property (nonatomic, assign) BOOL showTrafficLights;
136 
138 @property (nonatomic, assign) BOOL showCar;
139 
141 @property (nonatomic, assign) BOOL showRoute;
142 
144 @property (nonatomic, assign) BOOL showBackupRoute;
145 
147 @property (nonatomic, assign) BOOL showGreyAfterPass;
148 
150 @property (nonatomic, assign) CGFloat lineWidth;
151 
153 @property (nonatomic, strong, nullable) MACustomCalloutView *customCalloutView;
154 
156 @property (nonatomic, assign) CGFloat dashedLineWidth;
157 
159 @property (nonatomic, strong) UIColor *dashedLineColor;
160 
162 @property (nonatomic, strong) UIColor *dashedLineGreyColor;
163 
165 @property (nonatomic, copy, nullable) UIImage *greyTexture;
166 
168 @property (nonatomic, copy) NSDictionary<NSNumber *, UIImage *> *statusTextures;
169 
171 @property (nonatomic, copy, nullable) UIImage *normalTexture;
172 
177 - (void)setCameraImage:(nullable UIImage *)cameraImage;
178 
183 - (void)setStartPointImage:(nullable UIImage *)startPointImage;
184 
189 - (void)setWayPointImage:(nullable UIImage *)wayPointImage;
190 
195 - (void)setEndPointImage:(nullable UIImage *)endPointImage;
196 
201 - (void)setCarImage:(nullable UIImage *)carImage;
202 
207 - (void)setCarCompassImage:(nullable UIImage *)carCompassImage;
208 
213 - (void)addCustomAnnotation:(AMapNaviCompositeCustomAnnotation *)annotation;
214 
219 - (void)removeCustomAnnotation:(AMapNaviCompositeCustomAnnotation *)annotation;
220 
225 - (void)addCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)overlay;
226 
231 - (void)removeCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)overlay;
232 
233 #pragma mark - UI Element Options
234 
236 @property (nonatomic, assign) BOOL showUIElements;
237 
239 @property (nonatomic, assign) BOOL showCrossImage;
240 
242 @property (nonatomic, assign) BOOL showTrafficButton;
243 
245 @property (nonatomic, assign) BOOL showTrafficBar;
246 
248 @property (nonatomic, assign) BOOL showBrowseRouteButton;
249 
251 @property (nonatomic, assign) BOOL showMoreButton;
252 
253 #pragma mark - Other
254 
256 @property (nonatomic, assign, readonly) BOOL isLandscape;
257 
259 @property (nonatomic, assign) BOOL autoSwitchShowModeToCarPositionLocked;
260 
265 
266 @end
267 
268 @protocol AMapNaviDriveViewDelegate <NSObject>
269 @optional
270 
275 - (void)driveViewCloseButtonClicked:(AMapNaviDriveView *)driveView;
276 
281 - (void)driveViewMoreButtonClicked:(AMapNaviDriveView *)driveView;
282 
287 - (void)driveViewTrunIndicatorViewTapped:(AMapNaviDriveView *)driveView;
288 
294 - (void)driveView:(AMapNaviDriveView *)driveView didChangeShowMode:(AMapNaviDriveViewShowMode)showMode;
295 
301 - (void)driveView:(AMapNaviDriveView *)driveView didChangeTrackingMode:(AMapNaviViewTrackingMode)trackMode;
302 
308 - (void)driveView:(AMapNaviDriveView *)driveView didChangeOrientation:(BOOL)isLandscape;
309 
315 - (void)driveView:(AMapNaviDriveView *)driveView didChangeDayNightType:(BOOL)showStandardNightType;
316 
322 - (UIEdgeInsets)driveViewEdgePadding:(AMapNaviDriveView *)driveView;
323 
330 - (id)driveView:(AMapNaviDriveView *)driveView needUpdatePolylineOptionForRoute:(AMapNaviRoute *)naviRoute __attribute__((deprecated("已废弃,请使用 lineWidth、statusTextures、greyTexture、dashedLineColor 等相关属性替代, since 6.2.0")));
331 
332 @end
333 
334 NS_ASSUME_NONNULL_END
AMapNaviDriveView::scaleOrigin
CGPoint scaleOrigin
当前地图比例尺的原点位置. 注意:只有showUIElements为NO时,设置此值才有效.
Definition: AMapNaviDriveView.h:49
AMapNaviDriveView::showCamera
BOOL showCamera
路线上是否显示摄像头,默认YES
Definition: AMapNaviDriveView.h:114
AMapNaviDriveView::showMoreButton
BOOL showMoreButton
是否显示更多按钮,默认YES
Definition: AMapNaviDriveView.h:251
AMapNaviDriveViewDelegate-p
Definition: AMapNaviDriveView.h:268
AMapNaviDriveView::mapZoomLevel
CGFloat mapZoomLevel
当前地图的zoomLevel,修改zoomLevel会进入非锁车状态
Definition: AMapNaviDriveView.h:64
AMapNaviDriveView::showBrowseRouteButton
BOOL showBrowseRouteButton
是否显示全览按钮,默认YES
Definition: AMapNaviDriveView.h:248
AMapNaviDriveView::cameraDegree
CGFloat cameraDegree
锁车状态下地图cameraDegree, 默认35.0, 范围[0,60]
Definition: AMapNaviDriveView.h:70
AMapNaviDriveView::customCalloutView
MACustomCalloutView * customCalloutView
自定义导航界面自车图标的弹出框view, 设置为nil取消弹框. 注意:弹框功能同MAAnnotationView的customCalloutView, 弹框不会触发 mapView:didAnnota...
Definition: AMapNaviDriveView.h:153
AMapNaviDriveView::showBackupRoute
BOOL showBackupRoute
多路线导航模式下是否显示备选路线, 默认YES. since 6.7.0
Definition: AMapNaviDriveView.h:144
AMapNaviDriveView::turnArrowSideColor
UIColor * turnArrowSideColor
路线上转弯箭头设置3D箭头的侧边颜色(当turnArrowIs3D为YES时有效). since 6.6.0
Definition: AMapNaviDriveView.h:129
AMapNaviDriveView::lineWidth
CGFloat lineWidth
路线polyline的宽度,设置0恢复默认宽度
Definition: AMapNaviDriveView.h:150
AMapNaviDriveView::turnArrowWidth
CGFloat turnArrowWidth
路线上转弯箭头的宽度,设置0恢复默认宽度. since 6.2.0
Definition: AMapNaviDriveView.h:123
AMapNaviDriveView::mapShowTraffic
BOOL mapShowTraffic
地图是否显示交通路况,默认YES. since 6.1.0
Definition: AMapNaviDriveView.h:61
AMapNaviDriveView::showTrafficButton
BOOL showTrafficButton
是否显示实时交通按钮,默认YES
Definition: AMapNaviDriveView.h:242
AMapNaviDriveView::compassSize
CGSize compassSize
指南针的宽高. since 6.3.0
Definition: AMapNaviDriveView.h:58
AMapNaviDriveView::showTrafficBar
BOOL showTrafficBar
是否显示路况光柱,默认YES
Definition: AMapNaviDriveView.h:245
AMapNaviDriveView::autoZoomMapLevel
BOOL autoZoomMapLevel
锁车模式下是否为了预见下一导航动作自动缩放地图,默认为NO. since 6.2.0
Definition: AMapNaviDriveView.h:67
-[AMapNaviDriveView __attribute]
BOOL showStandardNightType __attribute((deprecated("已废弃, 请使用 mapViewModeType 替代 since 6.7.0")))
是否黑夜模式,默认NO.
AMapNaviCompositeCustomAnnotation
导航界面自定义标注 since 5.5.0
Definition: AMapNaviCompositeAnnotation.h:28
AMapNaviDriveView::dashedLineGreyColor
UIColor * dashedLineGreyColor
路线虚线部分走过后置灰的颜色 since 6.2.0
Definition: AMapNaviDriveView.h:162
AMapNaviDriveView::showVectorline
BOOL showVectorline
是否显示牵引线,默认YES. since 6.2.0
Definition: AMapNaviDriveView.h:132
AMapNaviCompositeOverlay-p
导航页添加自定overlay,需要遵守此协议 since 6.7.0
Definition: AMapNaviCompositeAnnotation.h:13
AMapNaviDriveView::greyTexture
UIImage * greyTexture
路线纹理部分走过后置灰的纹理图片,设置nil恢复默认纹理. 纹理图片需满足:长宽相等,且宽度值为2的次幂. since 6.2.0
Definition: AMapNaviDriveView.h:165
AMapNaviDriveView::logoCenter
CGPoint logoCenter
当前地图Logo位置, 必须在 AMapNaviDriveView.bounds 之内,否则会被忽略. 注意:只有showUIElements为NO时,设置此值才有效....
Definition: AMapNaviDriveView.h:40
AMapNaviDriveView::showScale
BOOL showScale
当前地图是否显示比例尺,默认NO. 注意:只有showUIElements为NO时,设置此值才有效.
Definition: AMapNaviDriveView.h:46
AMapNaviDriveDataRepresentable-p
AMapNaviDriveDataRepresentable协议.实例对象可以通过实现该协议,并将其通过 AMapNaviDriveManager 的addDataRepresentative:方法进行...
Definition: AMapNaviDriveDataRepresentable.h:24
AMapNaviDriveView::screenAnchor
CGPoint screenAnchor
地图的视图锚点. (0, 0)为左上角,(1, 1)为右下角. 可通过设置此值来改变自车图标的默认显示位置. 注意:只有showUIElements为NO时,设置此值才有效 since 6....
Definition: AMapNaviDriveView.h:73
AMapNaviDriveDataRepresentable.h
AMapNaviDriveView::showTurnArrow
BOOL showTurnArrow
路线上是否显示转向箭头,默认YES
Definition: AMapNaviDriveView.h:117
AMapNaviDriveView::maxRenderFrame
NSUInteger maxRenderFrame
当前地图最大帧数,有效的帧数为:60、30、20、10等能被60整除的数,默认为30. since 6.5.0
Definition: AMapNaviDriveView.h:76
AMapNaviDriveView::isLandscape
BOOL isLandscape
目前是否为横屏状态. since 6.2.0 内部会自行监听 UIDeviceOrientationDidChange 进行横竖屏切换,无需再设置此值,但用户要自行保证 AMapNaviDriveVie...
Definition: AMapNaviDriveView.h:256
AMapNaviCompositeAnnotation.h
AMapNaviHeaderHandler.h
AMapNaviDriveView::showMode
AMapNaviDriveViewShowMode showMode
导航界面显示模式,默认AMapNaviDriveViewShowModeCarPositionLocked
Definition: AMapNaviDriveView.h:35
AMapNaviDriveView::trackingMode
AMapNaviViewTrackingMode trackingMode
导航界面跟随模式,默认AMapNaviViewTrackingModeMapNorth
Definition: AMapNaviDriveView.h:32
-[AMapNaviDriveView __attribute]
BOOL autoSwitchDayNightType __attribute((deprecated("已废弃, 请使用 mapViewModeType 替代 since 6.7.0")))
地图是否自动切换白天黑夜模式,默认NO.
AMapNaviDriveView::showRoute
BOOL showRoute
是否显示路线,默认YES. 注意:路线上的相关信息,如摄像头(showCamera)、红绿灯(showTrafficLights)、转向箭头(showTurnArrow)、牵引线(showVectorl...
Definition: AMapNaviDriveView.h:141
MACustomCalloutView
自定义annotationView的弹出框. 注意:不会触发-(void)mapView: didAnnotationViewCalloutTapped: since 5....
Definition: MACustomCalloutView.h:14
AMapNaviDriveView::showCar
BOOL showCar
是否显示小车图标,默认YES. since 6.2.0
Definition: AMapNaviDriveView.h:138
AMapNaviDriveView::showTrafficLights
BOOL showTrafficLights
是否显示红绿灯图标,默认YES. since 6.2.0
Definition: AMapNaviDriveView.h:135
AMapNaviRoute
导航路径信息
Definition: AMapNaviRoute.h:132
AMapNaviDriveView::showCrossImage
BOOL showCrossImage
是否显示路口放大图,默认YES
Definition: AMapNaviDriveView.h:239
AMapNaviDriveView::turnArrowColor
UIColor * turnArrowColor
路线上转弯箭头颜色. since 6.1.0
Definition: AMapNaviDriveView.h:120
AMapNaviDriveView::mapViewModeType
AMapNaviViewMapModeType mapViewModeType
导航界面日夜模式类型, 默认为 AMapNaviViewMapModeTypeDay(白天模式) since 6.7.0
Definition: AMapNaviDriveView.h:79
AMapNaviDriveView::normalTexture
UIImage * normalTexture
标准路线Polyline的纹理图片,设置nil恢复默认纹理.纹理图片需满足:长宽相等,且宽度值为2的次幂
Definition: AMapNaviDriveView.h:171
AMapNaviDriveView::logoSize
CGSize logoSize
当前地图Logo的宽高. since 6.2.0
Definition: AMapNaviDriveView.h:43
AMapNaviDriveView::statusTextures
NSDictionary< NSNumber *, UIImage * > * statusTextures
带路况路线Polyline的纹理图片. 纹理图片需满足: 长宽相等,且宽度值为2的次幂. 例如:@(AMapNaviRouteStatusSlow): [UIImage Slow路况下的Image],...
Definition: AMapNaviDriveView.h:168
AMapNaviDriveView::autoSwitchShowModeToCarPositionLocked
BOOL autoSwitchShowModeToCarPositionLocked
当显示模式为非锁车模式时,是否在7秒后自动设置为锁车模式,默认为NO. since 5.3.0
Definition: AMapNaviDriveView.h:259
-[AMapNaviDriveView __attribute]
BOOL showTrafficLayer __attribute((deprecated("已废弃, 请使用 mapShowTraffic 结合 -statusTextures: 替代. since 7.4.0")))
是否显示实时交通图层(地图路况+路线路况),默认YES
AMapNaviDriveView::dashedLineWidth
CGFloat dashedLineWidth
路线polyline的虚线部分宽度,设置0恢复默认宽度
Definition: AMapNaviDriveView.h:156
AMapNaviDriveView::showGreyAfterPass
BOOL showGreyAfterPass
走过的路线是否置灰,默认为NO. since 6.2.0
Definition: AMapNaviDriveView.h:147
AMapNaviDriveView::showCompass
BOOL showCompass
是否显示指南针,默认NO
Definition: AMapNaviDriveView.h:52
AMapNaviDriveView::showUIElements
BOOL showUIElements
是否显示界面元素,默认YES
Definition: AMapNaviDriveView.h:236
AMapNaviDriveView::delegate
id< AMapNaviDriveViewDelegate > delegate
实现了 AMapNaviDriveViewDelegate 协议的类指针
Definition: AMapNaviDriveView.h:24
AMapNaviDriveView
驾车导航界面.该类实现AMapNaviDriveDataRepresentable协议,可通过 AMapNaviDriveManager 的addDataRepresentative:方法进行注册展示驾...
Definition: AMapNaviDriveView.h:19
AMapNaviCommonObj.h
AMapNaviDriveView::compassOrigin
CGPoint compassOrigin
指南针原点位置. since 6.3.0
Definition: AMapNaviDriveView.h:55
AMapNaviDriveView::turnArrowIs3D
BOOL turnArrowIs3D
路线上转弯箭头是否为3D箭头线,默认为YES. since 6.6.0
Definition: AMapNaviDriveView.h:126
-[AMapNaviDriveView updateRoutePolylineInTheVisualRangeWhenTheShowModeIsOverview]
void updateRoutePolylineInTheVisualRangeWhenTheShowModeIsOverview()
在全览状态下调用此函数能够让路线显示在可视区域内(排除EdgePadding后剩余的区域),保证路线不被自定义界面元素遮挡. 比如showUIElements为NO时(自定义界面)横竖屏切换后,可以调用...
MAMapCustomStyleOptions
Definition: MAMapCustomStyleOptions.h:12
AMapNaviDriveView::mapViewDelegate
id< MAMapViewDelegate > mapViewDelegate
可获得和 MAMapView 原始 Delegate 同样的能力. since 7.0.0
Definition: AMapNaviDriveView.h:27
AMapNaviDriveView::dashedLineColor
UIColor * dashedLineColor
路线虚线部分的颜色. since 6.2.0
Definition: AMapNaviDriveView.h:159
© 2017 高德信息技术有限公司 版权所有,保留所有权利。