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

376 lines
19 KiB
Objective-C
Raw Permalink 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.

//
// AMapNaviWalkView.h
// AMapNaviKit
//
// Created by AutoNavi on 15/12/28.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "AMapNaviHeaderHandler.h"
#import "AMapNaviCommonObj.h"
#import "AMapNaviWalkDataRepresentable.h"
#import "AMapNaviCompositeAnnotation.h"
NS_ASSUME_NONNULL_BEGIN
///步行导航界面显示模式
///Walking navigation interface display mode
typedef NS_ENUM(NSInteger, AMapNaviWalkViewShowMode)
{
AMapNaviWalkViewShowModeCarPositionLocked = 1, ///< 锁车状态 Locked car status
AMapNaviWalkViewShowModeOverview = 2, ///< 全览状态 Overview status
AMapNaviWalkViewShowModeNormal = 3, ///< 普通状态 Normal status
};
@protocol AMapNaviWalkViewDelegate;
///步行导航界面.该类实现 AMapNaviWalkDataRepresentable 协议,可通过 AMapNaviWalkManager 的addDataRepresentative:方法进行注册展示步行导航过程.
///Walking navigation interface, This class implements the AMapNaviWalkDataRepresentable protocol and can be registered to display the walking navigation process through the addDataRepresentative: method of AMapNaviWalkManager.
@interface AMapNaviWalkView : UIView<AMapNaviWalkDataRepresentable>
#pragma mark - Delegate
///实现了 AMapNaviWalkViewDelegate 协议的类指针
///Implements the class pointer of the AMapNaviWalkViewDelegate protocol
@property (nonatomic, weak) id<AMapNaviWalkViewDelegate> delegate;
/**
* @brief 增加用于接收View回调事件的Listener, 效果等同于delegate. 注意:该方法不会增加实例对象的引用计数(Weak Reference). since 10.1.300
* @param aListener 实现了 AMapNaviWalkViewDelegate 协议的实例
*/
- (void)addEventListener:(id<AMapNaviWalkViewDelegate>)aListener;
/**
* @brief 移除用于接收View回调事件的Listener. since 10.1.300
* @param aListener 实现了 AMapNaviWalkViewDelegate 协议的实例
*/
- (void)removeEventListener:(id<AMapNaviWalkViewDelegate>)aListener;
#pragma mark - Options
///目前是否为横屏状态. since 7.4.0 内部会自行监听 UIDeviceOrientationDidChange 进行横竖屏切换,无需再设置此值,但用户要自行保证 AMapNaviWalkView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight让 AMapNaviWalkView 能够跟着父View一起变化. 可通过回调 -walkView:didChangeOrientation: 获取横竖屏切换时机
///Whether it is currently in landscape mode. Since 7.4.0, the system automatically monitors UIDeviceOrientationDidChange for landscape/portrait switching, no need to set this value anymore. However, users must ensure that AMapNaviWalkView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight allows AMapNaviWalkView to change along with the parent View. The timing of screen orientation changes can be obtained through the callback -walkView:didChangeOrientation:
@property (nonatomic, assign, readonly) BOOL isLandscape;
///导航界面跟随模式,默认AMapNaviViewTrackingModeMapNorth
///Navigation interface follow mode, default is AMapNaviViewTrackingModeMapNorth
@property (nonatomic, assign) AMapNaviViewTrackingMode trackingMode;
///导航界面显示模式,默认AMapNaviWalkViewShowModeCarPositionLocked
///Navigation interface display mode, default is AMapNaviWalkViewShowModeCarPositionLocked
@property (nonatomic, assign) AMapNaviWalkViewShowMode showMode;
///是否显示界面元素,默认YES
///Whether to display interface elements, default is YES
@property (nonatomic, assign) BOOL showUIElements;
///是否显示全览按钮,默认YES
///Whether to display the overview button, default is YES
@property (nonatomic, assign) BOOL showBrowseRouteButton;
///是否显示更多按钮,默认YES
///Whether to display the more button, default is YES
@property (nonatomic, assign) BOOL showMoreButton;
///是否显示转向箭头,默认YES
///Whether to display the turn arrow, default is YES
@property (nonatomic, assign) BOOL showTurnArrow;
///是否显示传感器方向信息,默认NO.设置为YES后,自车图标方向将显示为设备方向
///Whether to display sensor orientation information, default NO. After setting to YES, the direction of the self-car icon will display as the device orientation
@property (nonatomic, assign) BOOL showSensorHeading __attribute((deprecated("Deprecated, the direction of the self-car icon will display as the device orientation, no longer supports setting. since 10.0.900")));
///导航界面中的地图样式类型,默认为 AMapNaviViewMapModeTypeDay(白天模式) 。注意只支持AMapNaviViewMapModeTypeDayAMapNaviViewMapModeTypeCustom且自定义地图只在非导航状态下可正常工作。since 10.1.200
///The map style type in the navigation interface, default is AMapNaviViewMapModeTypeDay (day mode). Note: Only AMapNaviViewMapModeTypeDay and AMapNaviViewMapModeTypeCustom are supported, and the custom map only works properly in non-navigation mode
@property (nonatomic, assign) AMapNaviViewMapModeType mapViewModeType;
///是否显示起终途点\步行轮渡扎点\禁行限行图标\封路图标等,默认为全显示.本View不支持轮渡点、禁限行、封路图标
///Whether to display start/end points, pedestrian/ferry stop points, prohibited driving restriction icons, closed road icons, etc. Defaults to all displayed. (Note: This View does not support ferry points, traffic restriction icons, or closed road icons.)
///@since 11.1.200
@property (nonatomic, assign) AMapNaviRouteAnnoState showRouteAnnotation;
#pragma mark - MapView
///是否显示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
///Whether to display the compass, default is NO
@property (nonatomic, assign) BOOL showCompass;
///非锁车状态下地图cameraDegree锁车态下内部会处理默认35.0,范围[0,60]。since 10.0.900
///Map cameraDegree in the unlocked state, it will be handled internally in the locked state, default is 35.0, range [0,60]
@property (nonatomic, assign) CGFloat cameraDegree;
///当前地图是否显示比例尺默认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;
///当前地图比例尺的原点位置,默认(10,10)。注意:只有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;
///地图的视图锚点. (0, 0)为左上角,(1, 1)为右下角. 可通过设置此值来改变自车图标的默认显示位置. 注意:只有showUIElements为NO时设置此值才有效 since 8.0.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 vehicle icon by setting this value. Note: This value only takes effect when showUIElements is NO.
@property (nonatomic, assign) CGPoint screenAnchor;
///指南针原点位置。since 8.0.0
///The origin position of the compass
@property (nonatomic, assign) CGPoint compassOrigin;
///锁车模式下是否为了预见下一导航动作自动缩放地图,默认为 NO. since 11.1.200
///Whether to automatically zoom the map to predict the next navigation action in locked vehicle mode. Default: NO. Since 11.1.200.
@property (nonatomic, assign) BOOL autoZoomMapLevel;
/**
* 当前地图的 zoomLevel;可设置锁车下地图缩放等级(配合在关闭了动态比例尺下生效). since 11.1.200
The current map zoomLevel; can set the map zoom level in locked mode (applies only when dynamic scale is disabled).
* @param zoom 缩放等级,取值范围 [14-18],默认 18
Zoom level. Valid range: [1418]. Default: 18.
* modified since 11.1.200
*/
@property (nonatomic, assign) CGFloat mapZoomLevel;
/**
* @brief 自定义地图样式设置,可以支持分级样式配置,如控制不同级别显示不同的颜色 (自 6.6.0 开始使用新版样式,旧版样式无法在新版接口 setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions 中使用,请到官网 (lbs.amap.com) 更新新版样式文件)
* Custom map style settings can support hierarchical style configurations, such as controlling different levels to display different colors (starting from version 6.6.0, the new style is used, and the old style cannot be used in the new interface setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions, please update the new style file on the official website (lbs.amap.com))
* @param styleOptions 自定义样式 options. since 6.6.0
* Custom style options
*/
- (void)setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions;
#pragma mark - Polyline Texture
///路线polyline的宽度,设置0恢复默认宽度
///The width of the route polyline, set to 0 to restore the default width.
@property (nonatomic, assign) CGFloat lineWidth;
///标准路线Polyline的纹理图片,设置nil恢复默认纹理.纹理图片需满足长宽相等且宽度值为2的次幂
///Texture image for standard route Polyline, set nil to restore default texture. The texture image must meet: equal length and width, and the width value must be a power of 2.
@property (nonatomic, copy, nullable) UIImage *normalTexture __attribute((deprecated("Deprecated, please use routeStatusColor instead. since 10.0.900")));
///走过的路线是否置灰,默认为NO. since 7.4.0
///Whether the traveled route is grayed out, default is NO.
@property (nonatomic, assign) BOOL showGreyAfterPass;
///路线纹理部分走过后置灰的纹理图片,设置nil恢复默认纹理. 纹理图片需满足长宽相等且宽度值为2的次幂. since 7.4.0
///The texture image of the route texture after being partially traveled, set nil to restore default texture. The texture image must meet: equal length and width, and the width value must be a power of 2.
@property (nonatomic, copy, nullable) UIImage *greyTexture __attribute((deprecated("Deprecated, please use routeGreyColor instead. since 10.0.900")));;
// 路线走过后置灰的颜色 since 10.0.900
//The color of the route after being traveled
@property (nonatomic, strong) AMapNaviPolylineGreyColor *routeGreyColor;
///路线的颜色,在调用 addDataRepresentative 前设置status 设置为 AMapNaviRouteStatusDefault since 10.0.900
///The color of the route should be set before calling addDataRepresentative, with the status set to AMapNaviRouteStatusDefault
@property (nonatomic, copy) AMapNaviPolylineTrafficStatusColor *routeStatusColor;
//纯导航模式使用
@property(nonatomic, assign) BOOL onlyForGuide;
#pragma mark - Other
/**
* @brief 在全览状态下调用此函数能够让路线显示在可视区域内(排除EdgePadding后剩余的区域),保证路线不被自定义界面元素遮挡. 比如showUIElements为NO时自定义界面横竖屏切换后可以调用此函数. since 8.0.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;
#pragma mark - Image
/**
* @brief 设置路径起点图标
* Set route start point icon
* @param startPointImage 起点图标
* Start point icon
*/
- (void)setStartPointImage:(nullable UIImage *)startPointImage;
/**
* @brief 设置路径终点图标
* Set route end point icon
* @param endPointImage 终点图标
* End point icon
*/
- (void)setEndPointImage:(nullable UIImage *)endPointImage;
/**
* @brief 设置自车图标
* Set vehicle icon
* @param carImage 自车图标
* Vehicle icon
*/
- (void)setCarImage:(nullable UIImage *)carImage;
/**
* @brief 设置自车罗盘图标
* Set vehicle compass icon
* @param carCompassImage 自车罗盘图标
* Vehicle compass icon
*/
- (void)setCarCompassImage:(nullable UIImage *)carCompassImage;
/**
* @brief 设置路径途经点图标 since 9.3.5
* Set route waypoint icon
* @param wayPointImage 途经点图标
* Waypoint icon
*/
- (void)setWayPointImage:(nullable UIImage *)wayPointImage;
#pragma mark - Annotation and Overlay
/**
* @brief 在导航地图中添加自定义标注. since 11.1.200
* 需要在自定义walkView被此接口addDataRepresentativer添加后调用否则会添加失败
* Add custom annotations to the navigation map. since 11.1.200
* This method must be called after the custom walkView is added by the addDataRepresentativer interface, otherwise the addition will fail
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param annotation 具体参考 AMapNaviCustomAnnotation
* Refer to AMapNaviCustomAnnotation for details
* @return 返回是否添加成功
* Return whether the addition was successful
*/
- (BOOL)addAnnotation:(AMapNaviCustomAnnotation *)annotation;
/**
* @brief 移除导航地图中的自定义标注. since 11.1.200
* Remove custom annotations from the navigation map. since 11.1.200
* 注意:生效范围 行前 行中
* Note: Effective scope is currently in progress
* @param annotation 自定义标注对象.
* Custom annotation object.
*/
- (void)removeAnnotation:(AMapNaviCustomAnnotation *)annotation;
/**
* @brief 在导航地图中添加自定义标注. since 11.1.200
* 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 11.1.200
* 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 11.1.200
* 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 11.1.200
* 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;
@end
@protocol AMapNaviWalkViewDelegate <NSObject>
@optional
/**
* @brief 导航界面关闭按钮点击时的回调函数
* Callback function when the close button is clicked on the navigation interface
* @param walkView 步行导航界面
* Walking navigation interface
*/
- (void)walkViewCloseButtonClicked:(AMapNaviWalkView *)walkView;
/**
* @brief 导航界面更多按钮点击时的回调函数
* Callback function when the more button is clicked on the navigation interface
* @param walkView 步行导航界面
* Walking navigation interface
*/
- (void)walkViewMoreButtonClicked:(AMapNaviWalkView *)walkView;
/**
* @brief 导航界面转向指示View点击时的回调函数
* Callback function when the turn indicator View is clicked in the navigation interface
* @param walkView 步行导航界面
* Walking navigation interface
*/
- (void)walkViewTrunIndicatorViewTapped:(AMapNaviWalkView *)walkView;
/**
* @brief 导航界面显示模式改变后的回调函数
* Callback function after the display mode of the navigation interface changes
* @param walkView 步行导航界面
* Walking navigation interface
* @param showMode 显示模式
* Display mode
*/
- (void)walkView:(AMapNaviWalkView *)walkView didChangeShowMode:(AMapNaviWalkViewShowMode)showMode;
/**
* @brief 导航界面跟随模式改变后的回调函数. since 7.4.0
* Callback function after the follow mode of the navigation interface changes
* @param walkView 步行导航界面
* Walking navigation interface
* @param trackMode 跟随模式
* Follow mode
*/
- (void)walkView:(AMapNaviWalkView *)walkView didChangeTrackingMode:(AMapNaviViewTrackingMode)trackMode;
/**
* @brief 导航界面横竖屏切换后的回调函数. since 7.4.0
* Callback function after switching between landscape and portrait modes in the navigation interface
* @param walkView 步行导航界面
* Walking navigation interface
* @param isLandscape 是否是横屏
* Is it in landscape mode
*/
- (void)walkView:(AMapNaviWalkView *)walkView didChangeOrientation:(BOOL)isLandscape;
/**
* @brief 导航界面白天黑夜模式切换后的回调函数. since 8.0.0
* Callback function after switching between day and night modes in the navigation interface
* @param walkView 步行导航界面
* Walking navigation interface
* @param showStandardNightType 是否为黑夜模式
* Is it in night mode
*/
- (void)walkView:(AMapNaviWalkView *)walkView didChangeDayNightType:(BOOL)showStandardNightType;
/**
* @brief 在showUIElements为NO时步行导航界面需要实时的取得可视区域比如切换成全览时、横竖屏切换时. 注意此回调只在showUIElements为NO时才会调用且比较频繁在获取EdgePadding时请勿进行大量的计算. since 8.0.0
* When showUIElements is NO, the walking navigation interface needs to obtain the visible area in real time, such as when switching to overview mode or during portrait-landscape screen rotation. Note: This callback is only called and relatively frequent when showUIElements is NO, please avoid heavy calculations when obtaining EdgePadding.
* @param walkView 步行导航界面
* Walking navigation interface
* @return 如(100, 50, 80, 60)表示的是walkView.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)walkViewEdgePadding:(AMapNaviWalkView *)walkView;
@end
NS_ASSUME_NONNULL_END