jsdw_ios/Pods/AMapNavi-NO-IDFA/AMapNaviKit.framework/Headers/AMapNaviDriveView.h

706 lines
37 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AMapNaviDriveView.h
// AMapNaviKit
//
// Created by AutoNavi on 15/12/28.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "AMapNaviHeaderHandler.h"
#import "AMapNaviCommonObj.h"
#import "AMapNaviDriveDataRepresentable.h"
#import "AMapNaviCompositeAnnotation.h"
#import "AMapNaviDriveViewConfig.h"
NS_ASSUME_NONNULL_BEGIN
@protocol AMapNaviDriveViewDelegate;
@protocol AMapNaviDriveViewResProxyDelegate;
///驾车导航界面.该类实现AMapNaviDriveDataRepresentable协议,可通过 AMapNaviDriveManager 的addDataRepresentative:方法进行注册展示驾车导航过程.
///Driving navigation interface. This class implements the AMapNaviDriveDataRepresentable protocol and can be registered to display the driving navigation process through the addDataRepresentative: method of AMapNaviDriveManager.
@interface AMapNaviDriveView : UIView <AMapNaviDriveDataRepresentable>
/**
* @brief 初始化接口 Initialize interface
@since 10.0.820
*/
- (instancetype)initWithFrame:(CGRect)frame viewConfig:(nullable AMapNaviDriveViewConfig *)config;
#pragma mark - Delegate
///实现了 AMapNaviDriveViewDelegate 协议的类指针
///Implements the class pointer of the AMapNaviDriveViewDelegate protocol
@property (nonatomic, weak) id<AMapNaviDriveViewDelegate> delegate;
/**
* @brief 增加用于接收View回调事件的Listener, 效果等同于delegate. 注意:该方法不会增加实例对象的引用计数(Weak Reference). since 10.1.300
* @param aListener 实现了 AMapNaviDriveViewDelegate 协议的实例
*/
- (void)addEventListener:(id<AMapNaviDriveViewDelegate>)aListener;
/**
* @brief 移除用于接收View回调事件的Listener. since 10.1.300
* @param aListener 实现了 AMapNaviDriveViewDelegate 协议的实例
*/
- (void)removeEventListener:(id<AMapNaviDriveViewDelegate>)aListener;
///实现了 AMapNaviDriveViewResProxyDelegate 协议的类指针
///Implements the class pointer of the AMapNaviDriveViewResProxyDelegate protocol
@property (nonatomic, weak) id<AMapNaviDriveViewResProxyDelegate> resProxydelegate;
///可获得和 MAMapView 原始 Delegate 同样的能力. since 7.0.0
///Can obtain the same capabilities as the original Delegate of MAMapView
@property (nonatomic, weak) id <MAMapViewDelegate> mapViewDelegate __attribute((deprecated("It is recommended to use the addAnnotaion/addCustomOverlay methods in AMapNaviDriveView for map custom annotations since version 10.0.920")));;
#pragma mark - Mode Options
///showMode为普通态时导航内部是否修改trackingMode默认为 YES。since 10.1.200
///Whether the navigation internally modifies trackingMode when showMode is in normal state, default is YES.
@property (nonatomic, assign) BOOL canChangeTrackingMode;
///导航界面跟随模式,默认AMapNaviViewTrackingModeCarNorth
///Navigation interface follow mode, default is AMapNaviViewTrackingModeCarNorth
///
@property (nonatomic, assign) AMapNaviViewTrackingMode trackingMode;
///导航界面显示模式,默认AMapNaviDriveViewShowModeCarPositionLocked
///Navigation interface display mode, default is AMapNaviDriveViewShowModeCarPositionLocked
///注意: 生效范围 行中
///Note: Effective scope in row
@property (nonatomic, assign) AMapNaviDriveViewShowMode showMode;
#pragma mark - Map Options
///当前地图Logo位置, 必须在 AMapNaviDriveView.bounds 之内,否则会被忽略. 注意:只有showUIElements为NO时设置此值才有效. since 6.2.0
///The current map logo position must be within AMapNaviDriveView.bounds, otherwise it will be ignored. Note: This setting only takes effect when showUIElements is NO.
@property (nonatomic, assign) CGPoint logoCenter;
///当前地图Logo的宽高. since 6.2.0
///The width and height of the current map logo
@property (nonatomic, assign, readonly) CGSize logoSize;
///是否显示logo仅支持海外包设置默认NO
///Whether to display the logo is only supported in overseas packages; the default is NO.
@property (nonatomic, assign) BOOL logoEnable;
///设置logo语言。国内包: 支持中文与英文, 默认中文。海外包:仅支持英文,默认英文。
///set logo language.
///Domestic package: supports Chinese and English, default Chinese;
///Overseas package: supports English only, default English.
@property (nonatomic, assign) MALogoLanguage logoLanguage;
///当前地图是否显示比例尺默认NO. 注意:只有showUIElements为NO时设置此值才有效.
///Whether the current map displays the scale, default is NO. Note: This value only takes effect when showUIElements is NO.
@property (nonatomic, assign) BOOL showScale;
///当前地图比例尺的原点位置. 注意:只有showUIElements为NO时设置此值才有效.
///The origin position of the current map scale, default is (10,10). Note: This value only takes effect when showUIElements is NO.
@property (nonatomic, assign) CGPoint scaleOrigin;
///是否显示指南针,默认NO
///Whether to display the compass, default is NO
@property (nonatomic, assign) BOOL showCompass;
///指南针原点位置. since 6.3.0
///The origin position of the compass
@property (nonatomic, assign) CGPoint compassOrigin;
///指南针的宽高. since 6.3.0
///The width and height of the compass
@property (nonatomic, assign, readonly) CGSize compassSize;
///地图是否显示交通路况默认YES. since 6.1.0
///Whether the map displays traffic conditions, default is YES.
@property (nonatomic, assign) BOOL mapShowTraffic;
///当前地图的zoomLevel修改zoomLevel会进入非锁车状态
///The current zoomLevel of the map, modifying the zoomLevel will enter the unlocked state
@property (nonatomic, assign) CGFloat mapZoomLevel;
///锁车模式下是否为了预见下一导航动作自动缩放地图,默认为YES。 since 10.0.2
///Whether the map automatically zooms in locked mode to anticipate the next navigation action, default is YES.
@property (nonatomic, assign) BOOL autoZoomMapLevel;
///非锁车状态下地图cameraDegree锁车态下内部会处理, 默认35.0, 范围[0,60]
///Map cameraDegree in unlocked state, which will be handled internally when locked, default 35.0, range [0,60]
@property (nonatomic, assign) CGFloat cameraDegree;
///地图的视图锚点. (0, 0)为左上角,(1, 1)为右下角. 可通过设置此值来改变自车图标的默认显示位置. 注意:只有showUIElements为NO时设置此值才有效 since 6.2.0
///The view anchor point of the map. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. You can change the default display position of the self-vehicle icon by setting this value. Note: This value only takes effect when showUIElements is NO.
@property (nonatomic, assign) CGPoint screenAnchor;
///当前地图最大帧数有效的帧数为60、30、20、10等能被60整除的数默认为60. since 6.5.0
///The maximum frame rate of the current map, valid frame rates are numbers divisible by 60 such as 60, 30, 20, 10, default is 60
@property (nonatomic, assign) NSUInteger maxRenderFrame;
///导航界面日夜模式类型, 默认为 AMapNaviViewMapModeTypeDay(白天模式) since 6.7.0
///Navigation interface day and night mode types, default is AMapNaviViewMapModeTypeDay (Day mode)
@property (nonatomic, assign) AMapNaviViewMapModeType mapViewModeType;
/**
* @brief 自定义地图样式设置,可以支持分级样式配置,如控制不同级别显示不同的颜色(自7.8.0开始使用新版样式,请到官网(lbs.amap.com)更新新版样式文件,否则无法正常显示路口放大图)
* Custom map style settings, support hierarchical style configuration, such as controlling different levels to display different colors (starting from version 7.8.0, use the new style, please update the new style file on the official website (lbs.amap.com), otherwise the junction enlargement map cannot be displayed normally)
* @param styleOptions 自定义样式options. since 6.6.0
* Custom style options
*/
- (void)setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions __attribute((deprecated("Custom View no longer supports custom map style. Since 11.1.000")));
///地图是否自动切换白天黑夜模式,默认NO.
///Does the map automatically switch between day and night mode, default is NO.
@property (nonatomic, assign) BOOL autoSwitchDayNightType __attribute((deprecated("Deprecated, please use mapViewModeType instead. since 6.7.0")));
///是否黑夜模式,默认NO.
///Is it in night mode, default is NO.
@property (nonatomic, assign) BOOL showStandardNightType __attribute((deprecated("Deprecated, please use mapViewModeType instead. since 6.7.0")));
#pragma mark - Annoation Options and Overlay Options
///是否显示实时交通图层(地图路况+路线路况),默认YES
///Whether to display real-time traffic layer (map traffic + route traffic), default is YES.
@property (nonatomic, assign) BOOL showTrafficLayer __attribute((deprecated("Deprecated, Please use mapShowTraffic combined with -statusTextures: replace. since 7.4.0")));
///路线上是否显示摄像头,默认YES
///Whether to display cameras on the route, default is YES.
@property (nonatomic, assign) BOOL showCamera;
///路线上是否显示转向箭头,默认YES
///Whether to display turn arrows on the route, default is YES.
@property (nonatomic, assign) BOOL showTurnArrow;
///路线上转弯箭头颜色. since 6.1.0
///The color of the turn arrows on the route
@property (nonatomic, strong) UIColor *turnArrowColor;
///路线上转弯箭头的宽度,设置0恢复默认宽度. since 6.2.0
///The width of the turn arrows on the route, set to 0 to restore the default width
@property (nonatomic, assign) CGFloat turnArrowWidth;
///路线上转弯箭头是否为3D箭头线,默认为YES. since 6.6.0
///Whether the turning arrow on the route is a 3D arrow line, default is YES.
@property (nonatomic, assign) BOOL turnArrowIs3D;
///路线上转弯箭头设置3D箭头的侧边颜色当turnArrowIs3D为YES时有效). since 6.6.0
///Set the side color of the 3D arrow for the turning arrow on the route (effective when turnArrowIs3D is YES)
@property (nonatomic, strong) UIColor *turnArrowSideColor;
///是否显示牵引线,默认YES. since 6.2.0
///Whether to display the traction line, default is YES
@property (nonatomic, assign) BOOL showVectorline;
///是否显示红绿灯图标,默认YES. since 6.2.0
///Whether to display the traffic light icon, default is YES
@property (nonatomic, assign) BOOL showTrafficLights;
///是否显示小车图标,默认YES. since 6.2.0
///Whether to display the car icon, default is YES.
@property (nonatomic, assign) BOOL showCar;
///是否显示路线,默认YES. 注意:路线上的相关信息,如摄像头(showCamera)、红绿灯(showTrafficLights)、转向箭头(showTurnArrow)、牵引线(showVectorline)、起终点等也会一同受控制,进行显示和隐藏. since 6.2.0
///Whether to display the route, default is YES. Note: relevant information on the route, such as cameras (showCamera), traffic lights (showTrafficLights), turning arrows (showTurnArrow), traction lines (showVectorline), start and end points, etc., will also be controlled to display and hide
@property (nonatomic, assign) BOOL showRoute;
///多路线导航模式下是否显示备选路线, 默认YES. since 6.7.0
///Whether to display alternative routes in multi-route navigation mode, default is YES.
@property (nonatomic, assign) BOOL showBackupRoute;
///走过的路线是否置灰,默认为NO. since 6.2.0
///Whether to gray out the traveled route, default is NO
@property (nonatomic, assign) BOOL showGreyAfterPass;
///路线polyline的宽度,设置0恢复默认宽度
///The width of the route polyline, set to 0 to restore the default width
@property (nonatomic, assign) CGFloat lineWidth;
///自定义导航界面自车图标的弹出框view, 设置为nil取消弹框. 注意:弹框功能同MAAnnotationView的customCalloutView, 弹框不会触发 mapView:didAnnotationViewCalloutTapped: 方法. since 5.1.0
///Custom pop-up view for the ego vehicle icon in the navigation interface. Set to nil to cancel the pop-up. Note: The pop-up function is the same as MAAnnotationView's customCalloutView, the popup will not trigger the mapView:didAnnotationViewCalloutTapped: method.
@property (nonatomic, strong, nullable) MACustomCalloutView *customCalloutView;
///路线虚线部分的颜色. since 6.2.0
///The color of the dashed part of the route
@property (nonatomic, strong) UIColor *dashedLineColor;
// 路线走过后置灰的颜色 since 10.0.2
//The color of the route after it has been traveled and grayed out
@property (nonatomic, strong) AMapNaviPolylineGreyColor *routeGreyColor;
///路线的路况颜色根据AMapNaviRouteStatus配置不同道路状态的颜色 since 10.0.2
///The traffic condition colors of the route are configured according to AMapNaviRouteStatus to display different road statuses
@property (nonatomic, copy) NSArray<AMapNaviPolylineTrafficStatusColor *> *routeStatusColor;
//设置自定义View是否显示鹰眼地图默认为NO。显示鹰眼小地图的时候光柱图和全览按钮隐藏。 特别注意:当前接口为收费接口,您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/。since 10.0.2
//Set whether the custom View displays the overview map, default is NO. When the overview mini-map is displayed, the light bar chart and overview button are hidden. Special Note: The current API is a paid service. If you wish to apply for a trial or official use, please submit a business cooperation ticket through the ticket system for communication https://lbs.amap.com/
@property (nonatomic, assign) BOOL showEagleMap;
///是否显示电子眼的距离默认为NO。since 10.0.2
///Whether to display the distance of electronic eyes, default is NO.
@property (nonatomic, assign) BOOL showCameraDistance;
///是否显示超速脉冲默认为NO。特别注意当前接口为收费接口您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/。since 10.0.2
///Whether to display speeding pulses, default is NO. Special Note: The current API is a paid service. If you wish to apply for a trial or official use, please submit a business cooperation ticket through the ticket system for communication https://lbs.amap.com/
@property (nonatomic, assign) BOOL showOverSpeedPulse;
///路线上是否显示拥堵气泡默认YES。 since 10.0.5
///Whether to display congestion bubbles on the route, default is YES.
@property (nonatomic, assign) BOOL showDriveCongestion;
///路线上是否显示红绿灯倒计时开启付费权限时默认YES。特别注意当前接口为收费接口您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/。since 10.0.5
///Whether to display traffic light countdown on the route, default is YES when paid permissions are enabled. Special Note: The current API is a paid service. If you wish to apply for a trial or official use, please submit a business cooperation ticket through the ticket system for communication https://lbs.amap.com/
///路线上是否显示红绿灯倒计时开启付费权限时默认YES。特别注意当前接口为收费接口您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/。since 10.0.5
///Whether the countdown of traffic lights is displayed on the route, and the default is YES when the payment permission is enabled. Special note: The current interface is a charging interface. If you apply for trial or formal application, please submit a business cooperation work order through the work order system for communication https://lbs.amap.com/ 。since 10.0.5
///注意:生效范围 行中
///Note: Effective scope is currently in progress
@property (nonatomic, assign) BOOL showTrafficLightView;
//纯导航模式使用
@property(nonatomic, assign) BOOL onlyForGuide;
/**
* @brief 设置摄像头图标
* Set camera icon
* 注意:与showCamera 相关
* @param cameraImage 摄像头图标。
* Camera icon
*/
- (void)setCameraImage:(nullable UIImage *)cameraImage;
/**
* @brief 设置路径起点图标
* Set route start point icon
* @param startPointImage 起点图标
* Start point icon
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param startPointImage 起点图标,设置nil为默认图标
* Start point icon, set nil as default icon
*/
- (void)setStartPointImage:(nullable UIImage *)startPointImage;
/**
* @brief 设置路径途经点图标
* Set route waypoint icon
* @param wayPointImage 途经点图标
* Waypoint icon
* 注意:生效范围 行前 行中
* @param wayPointImage 途经点图标,设置nil为默认图标
* Waypoint icon, set nil as the default icon
*/
- (void)setWayPointImage:(nullable UIImage *)wayPointImage;
/**
* @brief 设置路径终点图标
* Set route end point icon
* @param endPointImage 终点图标
* End point icon
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param endPointImage 终点图标,设置nil为默认图标
* endPointImage destination icon, set nil as default icon
*/
- (void)setEndPointImage:(nullable UIImage *)endPointImage;
/**
* @brief 设置自车图标
* Set vehicle icon
* @param carImage 自车图标
* Vehicle icon
* 注意:与是否显示小车图标 属性相关
* Note: Related to whether the car icon attribute is displayed or not
* @param carImage 自车图标,设置nil为默认图标
* Car icon, set nil as default icon
*/
- (void)setCarImage:(nullable UIImage *)carImage;
/**
* @brief 设置自车图标,保持图片大小
* 与 (void)setCarImage:(nullable UIImage *)carImage; 效果一样
* Set the ego vehicle icon and maintain the image size Compared to (void) setCarImage: (voidable UIImage *) carImage; The effect is the same
* @param carImage 自车图标,设置nil为默认图标
* Car icon, set nil as default icon
*/
- (void)setCarImageWithSize:(nullable UIImage *)carImage;
/**
* @brief 设置自车罗盘图标
* Set vehicle compass icon
* @param carCompassImage 自车罗盘图标
* Vehicle compass icon
* 注意:与是否显示小车图标 属性相关, 行中生效
* Note: Related to whether to display the car icon attribute, effective in the row
* @param carCompassImage 自车罗盘图标,设置nil为默认图标
* Vehicle compass icon, set nil as default icon
*/
- (void)setCarCompassImage:(nullable UIImage *)carCompassImage;
/**
* @brief 在导航地图中添加自定义标注. since 10.0.920
* 需要在自定义driveView被此接口addDataRepresentativer添加后调用否则会添加失败
* Add custom annotations to the navigation map. since 10.0.920
* This method must be called after the custom driveView is added by the addDataRepresentativer interface, otherwise the addition will fail
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* 使用示例:
* Usage example:
* AMapNaviCustomAnnotationItemIconModel* iconNormal = [AMapNaviCustomAnnotationItemIconModel new];
iconNormal.image = [UIImage imageNamed: @"default_navi_route_startpoint"];
AMapNaviCustomAnnotation *annotaion = [[AMapNaviCustomAnnotation alloc] initWithCoordinate:CLLocationCoordinate2DMake(40.027438, 116.446969) iconModel:iconNormal];
* BOOL result = [self.driveView addAnnotation:annotaion];
if (result) {
NSLog(@"add succuss");
}
annotaion.clickBlock = ^() {
NSLog(@"on clicked annotaion:%@",annotaion);
};
* @param annotation 具体参考 AMapNaviCustomAnnotation
* Refer to AMapNaviCustomAnnotation for details
* @return 返回是否添加成功
* Return whether the addition was successful
*/
- (BOOL)addAnnotation:(AMapNaviCustomAnnotation *)annotation;
/**
* @brief 移除导航地图中的自定义标注. since 10.0.920
* Remove custom annotations from the navigation map. since 10.0.920
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param annotation 自定义标注对象.
* Custom annotation object.
*/
- (void)removeAnnotation:(AMapNaviCustomAnnotation *)annotation;
/**
* @brief 在导航地图中添加自定义标注. since 6.2.0
* Add custom annotations to the navigation map
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param annotation 具体参考 AMapNaviCompositeCustomAnnotation .
* Refer to AMapNaviCompositeCustomAnnotation
*/
- (void)addCustomAnnotation:(AMapNaviCompositeCustomAnnotation *)annotation;
/**
* @brief 移除导航地图中的自定义标注. since 6.2.0
* Remove custom annotations from the navigation map
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param annotation 具体参考 AMapNaviCompositeCustomAnnotation .
* Refer to AMapNaviCompositeCustomAnnotation
*/
- (void)removeCustomAnnotation:(AMapNaviCompositeCustomAnnotation *)annotation;
/**
* @brief 在导航地图中添加自定义overlay. since 6.7.0
* Add custom overlay to the navigation map
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param overlay 具体参考 官方Demo中 DriveViewWithCustomOverlayViewController .
* For details, refer to the official Demo DriveViewWithCustomOverlayViewController
*/
- (void)addCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)overlay;
/**
* @brief 移除导航地图中的自定义overlay. since 6.7.0
* Remove custom overlay from navigation map
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param overlay 具体参考 AMapNaviCompositeOverlay .
* Refer to AMapNaviCompositeOverlay
*/
- (void)removeCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)overlay;
#pragma mark - UI Element Options
///是否显示界面元素,默认YES
///Whether to display interface elements, default is YES
@property (nonatomic, assign) BOOL showUIElements;
///是否显示路口放大图默认YES
///Whether to display junction zoom, default is YES
@property (nonatomic, assign) BOOL showCrossImage;
///是否显示实时交通按钮,默认YES
///Whether to display real-time traffic button, default is YES
@property (nonatomic, assign) BOOL showTrafficButton;
///是否显示路况光柱图,默认YES
///Whether to display traffic light column, default is YES
@property (nonatomic, assign) BOOL showTrafficBar;
///是否显示全览按钮,默认YES
///Whether to display overview button, default is YES
@property (nonatomic, assign) BOOL showBrowseRouteButton;
///是否显示更多按钮,默认YES
///Whether to show more buttons, default is YES
@property (nonatomic, assign) BOOL showMoreButton;
///光柱图位置。since 10.0.2
///Beam chart position
@property (nonatomic, assign) CGRect tmcRouteFrame;
///光柱图颜色根据AMapNaviRouteStatus配置不同道路状态的颜色AMapNaviRouteStatusUnknow 的可以不做配置。since 10.0.2
/// Beam chart color, configure colors for different road statuses according to AMapNaviRouteStatus, AMapNaviRouteStatusUnknow can be left unconfigured
@property (nonatomic, copy) NSArray<AMapNaviTMCStatusColor *> *tmcRouteColor;
///是否执行驾车导航动画开关包括转场动画和导航态动画。since 10.1.111
///Whether to enable the driving navigation animation switch, including: transition animation and navigation state animation
@property (nonatomic, assign) BOOL showDriveGuideNaviAnimation;
///是否显示刷新按钮,默认YES
///Whether to display refresh button, default is YES
@property (nonatomic, assign) BOOL showRefreshButton;
#pragma mark - Other
///目前是否为横屏状态. since 6.2.0 内部会自行监听 UIDeviceOrientationDidChange 进行横竖屏切换,无需再设置此值,但用户要自行保证 AMapNaviDriveView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight让 AMapNaviDriveView 能够跟着父View一起变化. 可通过回调 -driveView:didChangeOrientation: 获取横竖屏切换时机
///Whether it is currently in landscape mode. Since 6.2.0, the system automatically monitors UIDeviceOrientationDidChange for landscape/portrait switching, no need to set this value anymore. However, users must ensure that AMapNaviDriveView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight allows AMapNaviDriveView to change along with the parent View. The timing of screen orientation changes can be obtained through the callback -driveView:didChangeOrientation:
@property (nonatomic, assign, readonly) BOOL isLandscape;
///当显示模式为非锁车模式时是否在7秒后自动设置为锁车模式默认为NO. since 5.3.0
///When the display mode is non-locked mode, whether to automatically set to locked mode after 7 seconds, default is NO
///注意:生效范围 行中
///Note: Effective scope is currently in progress
@property (nonatomic, assign) BOOL autoSwitchShowModeToCarPositionLocked;
/**
* @brief 在全览状态下调用此函数能够让路线显示在可视区域内(排除EdgePadding后剩余的区域),保证路线不被自定义界面元素遮挡. 比如showUIElements为NO时自定义界面横竖屏切换后可以调用此函数. since 6.2.0
* Calling this function in overview mode ensures the route is displayed within the visible area (remaining region after excluding EdgePadding), preventing the route from being obscured by custom UI elements. For example, when showUIElements is set to NO (custom interface), this function can be called after switching between portrait and landscape modes
*/
- (void)updateRoutePolylineInTheVisualRangeWhenTheShowModeIsOverview;
/**
* @brief 回到行前状态只有用户初始状态是行前时且当前是行中时返回YES,其它状态返回NO
* Return to the pre line state, only when the user's initial state is pre line and the current state is in line, return YES; for other states, return NO
* @since 10.0.820
*/
- (BOOL)goBackToPlanState;
@end
@protocol AMapNaviDriveViewDelegate <NSObject>
@optional
/**
* @brief 导航界面关闭按钮点击时的回调函数
* Callback function when the close button is clicked on the navigation interface
* @param driveView 驾车导航界面
* Driving navigation interface
*/
- (void)driveViewCloseButtonClicked:(AMapNaviDriveView *)driveView;
/**
* @brief 导航界面更多按钮点击时的回调函数
* Callback function when the more button is clicked on the navigation interface
* @param driveView 驾车导航界面
* Driving navigation interface
*/
- (void)driveViewMoreButtonClicked:(AMapNaviDriveView *)driveView;
/**
* @brief 导航界面转向指示View点击时的回调函数
* Callback function when the turn indicator View is clicked in the navigation interface
* @param driveView 驾车导航界面
* Driving navigation interface
*/
- (void)driveViewTrunIndicatorViewTapped:(AMapNaviDriveView *)driveView;
/**
* @brief 导航界面显示模式改变后的回调函数
* Callback function after the display mode of the navigation interface changes
* @param driveView 驾车导航界面
* Driving navigation interface
* @param showMode 显示模式
* Display mode
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeShowMode:(AMapNaviDriveViewShowMode)showMode;
/**
* @brief 驾车导航界面跟随模式改变后的回调函数. since 6.2.0
* Callback function after the follow mode of the navigation interface changes
* @param driveView 驾车导航界面
* Driving navigation interface
* @param trackMode 跟随模式
* Follow mode
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeTrackingMode:(AMapNaviViewTrackingMode)trackMode;
/**
* @brief 驾车导航界面跟随模式改变动画执行完成的回调函数可在此函数中设置地图状态。注意只有在showMode为AMapNaviDriveViewShowModeNormal时才会回调。 since 10.0.2
* Callback function executed after the animation of the driving navigation interface's following mode change is completed, where the map state can be set within this function. Note that the callback is only triggered when showMode is AMapNaviDriveViewShowModeNormal.
* @param driveView 驾车导航界面
* Driving navigation interface
*/
- (void)driveViewTrackingModeAnimationFinished:(AMapNaviDriveView *)driveView;
/**
* @brief 驾车导航界面横竖屏切换后的回调函数. since 6.2.0
* Callback function after switching between landscape and portrait modes in the navigation interface
* 如果使用行前功能行前只支持竖屏横竖屏切换需要用户请使用Controller相关接口自动行判断。
* If using the pre line function, the pre line only supports vertical screen, and switching between horizontal and vertical screens requires users to use the Controller's relevant interface to automatically determine.
* @param driveView 驾车导航界面
* Driving navigation interface
* @param isLandscape 是否是横屏
* Is it in landscape mode
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeOrientation:(BOOL)isLandscape;
/**
* @brief 驾车导航界面白天黑夜模式切换后的回调函数. since 6.2.0
* Callback function after switching between day and night modes in the navigation interface
* @param driveView 驾车导航界面
* Driving navigation interface
* @param showStandardNightType 是否为黑夜模式
* Is it in night mode
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeDayNightType:(BOOL)showStandardNightType;
/**
* @brief 在showUIElements为NO时驾车导航界面需要实时的取得可视区域比如切换成全览时、横竖屏切换时、动态计算地图的缩放级别时. 注意此回调只在showUIElements为NO时才会调用且比较频繁在获取EdgePadding时请勿进行大量的计算. since 6.2.0
* When showUIElements is NO, the driving navigation interface needs to obtain the visible area in real time, such as when switching to full view, when switching between landscape and portrait, and when dynamically calculating the zoom level of the map. Note: This callback is only called and relatively frequent when showUIElements is NO, please avoid heavy calculations when obtaining EdgePadding.
* @param driveView 驾车导航界面
* Driving navigation interface
* @return 如(100, 50, 80, 60)表示的是driveView.bounds 上边留出100px左边留出50px底部留出80px右边留出60px后的区域为可视区域一般EdgePadding的值由用户的界面布局决定.
* For example, (100, 50, 80, 60) means: the area left after leaving 100px at the top, 50px at the left, 80px at the bottom, and 60px at the right of walkView.bounds is the visible area. The value of EdgePadding is generally determined by the user's interface layout.
*/
- (UIEdgeInsets)driveViewEdgePadding:(AMapNaviDriveView *)driveView;
/**
* @brief 路线规划状态返回按钮点击
* Click the route planning status return button
* @param driveView 驾车导航界面
* Driving navigation interface
* @since 10.0.820
*/
- (void)driveViewOnSearchBarBackClicked:(AMapNaviDriveView *)driveView;
/**
* @brief 设置页面\路径规划页 驾车路径规划策略改变调用此方法
* Set Page Path Planning Page Driving Path Planning Strategy Change Call this method
* @param driveView 驾车导航界面
* Driving navigation interface
* @param driveStrategy 驾车路径规划策略,参考 AMapNaviDrivingStrategy .
* Driving route planning strategy, refer to AMapNaviDrivingStrategy.
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)driveView onDriveStrategyChanged:(AMapNaviDrivingStrategy)driveStrategy;
/**
* @brief 导航语音播报模式设置改变的回调函数.
* Callback function for changes in navigation voice broadcast mode settings.
* @param type 参考 AMapNaviCompositeBroadcastType .
* Refer to AMapNaviCompositeBroadcastType.
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeBroadcastType:(AMapNaviCompositeBroadcastType)type;
/**
* @brief 比例尺智能缩放设置改变的回调函数.
* The callback function for changing the intelligent scaling setting of the scale bar
* @param autoZoomMapLevel 锁车模式下是否为了预见下一导航动作自动缩放地图
* Does the map automatically zoom to anticipate the next navigation action in car lock mode
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeAutoZoomMapLevel:(BOOL)autoZoomMapLevel;
/**
* @brief 导航界面地图的日夜模式设置改变的回调函数.
* The callback function for changing the day and night mode settings of the navigation interface map
* @param type 参考 AMapNaviViewMapModeType .
* Refer to AMapNaviViewMapModeType .
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeMapViewModeType:(AMapNaviViewMapModeType)type;
/**
* @brief 导航界面地图的鹰眼地图设置改变的回调函数.
* The callback function for changing the eagle eye map settings on the navigation interface map
*
* @param show: YES鹰眼地图显示NO不显示
* YES: Eagle Eye map display, NO: Not displayed
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)driveView didChangeShowEagleMap:(BOOL)show;
/**
* @brief 导航界面页面状态变化
* Navigation interface page status changes
* @param AMapNaviDriveViewState
* @since 10.0.820
*/
- (void)driveView:(AMapNaviDriveView *)view didChangeToState:(AMapNaviDriveViewState)state;
/// 异步截图代理回调
/// Asynchronous screenshot agent callback
/// - Parameters:
/// - driveView: 导航自定义View
/// Customize Navigation View
/// - image: 返回截屏的图片
/// Return the screenshot image
/// - state: 0载入不完整1完整
/// 0 incomplete loading, 1 complete
- (void)driveView:(AMapNaviDriveView *)driveView asyncScreenShot:(UIImage *)image state:(NSInteger)state;
/**
* @brief 路线规划页面起终点输入内容变化如果callback返回的tips 为空或者个数为 0 展示 提示:“查无结果”
* 实现此接口后内部不再发起inputTip网络请求使用callback返回的结果展示输入提示
* The start and end point input content changes on the route planning page. If the tips returned by the callback are empty or the count is 0, display the prompt: 'No results found'
* After implementing this interface, the inputTip network request will no longer be initiated internally, and the input prompt will be displayed using the result returned by callback
* @param driveView: AMapNaviDriveView
* inputText: 输入框内容
* Input box content
* callback: tips数组建议一次返回10条以内数据
* The tips array suggests returning no more than 10 items at a time
* @since 10.0.921
*/
- (void)driveView:(AMapNaviDriveView *)driveView onInputChange:(NSString *)inputText callBack:(void (^)(NSArray<AMapNaviInputTip *> *tips))callback;
/**
* @brief 导航界面的服务区卡片View点击时触发的剩余服务区列表回调函数
* The callback function for the remaining service area list triggered when clicking on the service area card View in the navigation interface
* @param driveView 驾车导航界面
* Driving navigation interface
* @param remainServiceAreaDetails 剩余服务区列表详情
* Details of the remaining service area list
* @since 10.2.0
*/
- (void)driveView:(AMapNaviDriveView *)driveView updateRemainServiceAreaDetailInfos:(nullable NSArray<AMapNaviServiceAreaDetailInfo *> *)remainServiceAreaDetails;
/**
* @brief 导航高亮(主)路线更新
* Navigation highlight (main) route update
* @param highLightPathId 高亮路线ID
* Highlight (Primary) Route ID
* @param triggerType 触发换路的类型 0:自动切换(自动走上备选路) 1:手动点击路线换路(手动点击路线换路/手动点击路线气泡换路)
* Route Switch Trigger Types: 0: Automatic Switch (Automatically take the alternative route), 1: Manual Click Route Switch (Manual route switch by clicking the route / Manual route switch by clicking the route bubble).
*/
- (void)driveView:(AMapNaviDriveView *)driveView onRouteHighlightChange:(NSInteger)pathId triggerType:(NSInteger)triggerType;
@end
#pragma mark - AMapNaviDriveViewResProxyDelegate
@protocol AMapNaviDriveViewResProxyDelegate <NSObject>
@optional
/**
* @brief 导航外部资源加载代理接口类
* Navigation External Resource Loading Proxy Interface Class
* @param driveManager 驾车导航管理类
* Driving Navigation Management Class
* @param res_url 要求需包含amap_navi_external_image字符串区分外部资源加载
* Requires the inclusion of the amap_navi_external_image string to distinguish external resource loading
* @return 资源image
* Resource image
*/
- (UIImage *)getResourceFromExternal:(NSString *)resUrl;
@end
NS_ASSUME_NONNULL_END