299 lines
17 KiB
Objective-C
299 lines
17 KiB
Objective-C
//
|
||
// AMapNaviManager.h
|
||
// AMapNaviKit
|
||
//
|
||
// Created by eidan on 2017/5/9.
|
||
// Copyright © 2017年 Amap. All rights reserved.
|
||
//
|
||
|
||
#import "AMapNaviCommonObj.h"
|
||
|
||
@class AMapNaviRoute;
|
||
@class AMapNaviLocation;
|
||
@class AMapNaviCompositeUserConfig;
|
||
@class AMapNaviCustomAnnotation;
|
||
@protocol AMapNaviCompositeOverlay;
|
||
@protocol MAMapViewDelegate;
|
||
@class AMapNaviCompositeCustomAnnotation;
|
||
|
||
@protocol AMapNaviCompositeManagerDelegate;
|
||
|
||
///导航组件类 since 5.1.0 注意:AMapNaviCompositeManager 内部使用了单例 [AMapNaviDriveManager sharedInstance]
|
||
///Navigation component class. Note: AMapNaviCompositeManager internally uses the singleton [AMapNaviDriveManager sharedInstance]
|
||
@interface AMapNaviCompositeManager : NSObject
|
||
|
||
///实现了 AMapNaviCompositeManagerDelegate 协议的类指针
|
||
///Implements the class pointer of the AMapNaviCompositeManagerDelegate protocol
|
||
@property (nonatomic, weak, nullable) id<AMapNaviCompositeManagerDelegate>delegate;
|
||
|
||
///当前选择的导航路径的ID
|
||
///ID of the currently selected navigation route
|
||
@property (nonatomic, readonly) NSInteger naviRouteID;
|
||
|
||
///当前选择的导航路径的信息,参考 AMapNaviRoute 类.
|
||
///Information of the currently selected navigation route, refer to AMapNaviRoute class
|
||
@property (nonatomic, readonly, nullable) AMapNaviRoute *naviRoute;
|
||
|
||
///路径规划后的所有路径ID,路径ID为 NSInteger 类型.
|
||
///All route IDs after route planning, route ID is of NSInteger type
|
||
@property (nonatomic, readonly, nullable) NSArray<NSNumber *> *naviRouteIDs;
|
||
|
||
///路径规划后的所有路径信息,参考 AMapNaviRoute 类.
|
||
///All route information after route planning, refer to AMapNaviRoute class
|
||
@property (nonatomic, readonly, nullable) NSDictionary<NSNumber *, AMapNaviRoute *> *naviRoutes;
|
||
|
||
/**
|
||
* @brief 通过present的方式显示导航组件页面 注意:此函数涉及到UI操作,请在主线程中调用,否则无效.
|
||
* Display the navigation component page via the present method. Note: This function involves UI operations, please call it in the main thread, otherwise it will be invalid
|
||
* @param options 导航组件的配置类,参考 AMapNaviCompositeUserConfig .
|
||
* Configuration class of the navigation component, refer to AMapNaviCompositeUserConfig
|
||
*/
|
||
- (void)presentRoutePlanViewControllerWithOptions:(AMapNaviCompositeUserConfig *_Nullable)options;
|
||
|
||
/**
|
||
* @brief 退出导航组件页面 注意:此函数涉及到UI操作,请在主线程中调用,否则无效. since 5.5.0
|
||
* Exit the navigation component page. Note: This function involves UI operations, please call it in the main thread, otherwise it will be invalid
|
||
* @param animated 是否执行动画
|
||
* Whether to execute animation
|
||
*/
|
||
- (void)dismissWithAnimated:(BOOL)animated;
|
||
|
||
/**
|
||
* @brief 在驾车导航界面添加自定义标注 (AMapNaviCustomAnnotation 类型). 注意:每次退出导航之后,标注都会被清空. since 5.5.0
|
||
* Add custom annotations on the driving navigation interface (AMapNaviCustomAnnotation type). Note: After each exit from navigation, the annotations will be cleared
|
||
* @param annotation 会被显示在驾车导航界面地图上, 具体参考 AMapNaviCustomAnnotation .
|
||
* Will be displayed on the map in the driving navigation interface, for details, refer to AMapNaviCustomAnnotation
|
||
*/
|
||
- (void)addAnnotation:(AMapNaviCustomAnnotation *_Nonnull)annotation;
|
||
|
||
/**
|
||
* @brief 在驾车导航界面添加自定义标注 (AMapNaviCompositeCustomAnnotation 类型). 注意:每次退出导航之后,标注都会被清空. since 5.5.0
|
||
* Add custom annotations on the driving navigation interface (AMapNaviCompositeCustomAnnotation type). Note: After each exit from navigation, the annotations will be cleared
|
||
* @param annotation 会被显示在驾车导航界面地图上, 具体参考 AMapNaviCompositeCustomAnnotation .
|
||
* Will be displayed on the map in the driving navigation interface, for details, refer to AMapNaviCompositeCustomAnnotation
|
||
*/
|
||
- (void)addCompositeAnnotation:(AMapNaviCompositeCustomAnnotation *_Nonnull)annotation;
|
||
|
||
/**
|
||
* @brief 移除驾车导航界面的自定义标注 (AMapNaviCustomAnnotation 类型). since 5.5.0
|
||
* Remove custom annotations from the driving navigation interface (AMapNaviCustomAnnotation type)
|
||
* @param annotation 具体参考 AMapNaviCustomAnnotation .
|
||
* For details, refer to AMapNaviCustomAnnotation
|
||
*/
|
||
- (void)removeAnnotation:(AMapNaviCustomAnnotation *_Nonnull)annotation;
|
||
|
||
/**
|
||
* @brief 移除驾车导航界面的自定义标注 (AMapNaviCompositeCustomAnnotation 类型). since 5.5.0
|
||
* Remove custom annotations from the driving navigation interface (AMapNaviCompositeCustomAnnotation type)
|
||
* @param annotation 具体参考 AMapNaviCompositeCustomAnnotation .
|
||
* For details, refer to AMapNaviCompositeCustomAnnotation
|
||
*/
|
||
- (void)removeCompositeAnnotation:(AMapNaviCompositeCustomAnnotation *_Nonnull)annotation;
|
||
|
||
/**
|
||
* @brief 在驾车导航界面添加自定义Overlay. 注意:每次退出导航之后,Overlay都会被清空. since 6.7.0
|
||
* Add a custom Overlay to the driving navigation interface. Note: Every time you exit navigation, the Overlay will be cleared
|
||
* @param customOverlay 会被显示在驾车导航界面地图上, 此对象需遵守AMapNaviCompositeOverlay协议,否则无效, 具体参考官方Demo CustomOverlayCompositeViewController 类 .
|
||
* Will be displayed on the driving navigation interface map. This object must comply with the AMapNaviCompositeOverlay protocol, otherwise it will be invalid. For details, please refer to the official Demo CustomOverlayCompositeViewController class
|
||
*/
|
||
- (void)addCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)customOverlay;
|
||
|
||
/**
|
||
* @brief 移除驾车导航界面的自定义Overlay. since 6.7.0
|
||
* Remove the custom Overlay from the driving navigation interface
|
||
* @param customOverlay 具体参考 AMapNaviCompositeOverlay .
|
||
* For details, refer to AMapNaviCompositeOverlay
|
||
*/
|
||
- (void)removeCustomOverlay:(id <AMapNaviCompositeOverlay>_Nonnull)customOverlay;
|
||
@end
|
||
|
||
///AMapNaviCompositeManagerDelegate 协议 since 5.1.0
|
||
///AMapNaviCompositeManagerDelegate Protocol since 5.1.0
|
||
@protocol AMapNaviCompositeManagerDelegate <NSObject>
|
||
|
||
@optional
|
||
|
||
/**
|
||
* @brief 发生错误时,会调用此方法
|
||
* This method is called when an error occurs
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param error 错误信息
|
||
* Error message
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager error:(NSError *_Nonnull)error;
|
||
|
||
/**
|
||
* @brief 算路成功后的回调函数, 路径规划页面的算路、导航页面的重算等成功后均会调用此方法
|
||
* The callback function after successful route calculation, which will be called after successful route calculation on the route planning page or re-calculation on the navigation page
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
*/
|
||
- (void)compositeManagerOnCalculateRouteSuccess:(AMapNaviCompositeManager *_Nonnull)compositeManager;
|
||
|
||
/**
|
||
* @brief 算路成功后的回调函数. since 5.5.0
|
||
* The callback function after successful route calculation
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param type 路径规划类型,参考 AMapNaviRoutePlanType .
|
||
* Route planning type, refer to AMapNaviRoutePlanType
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type;
|
||
|
||
/**
|
||
* @brief 算路失败后的回调函数,路径规划页面的算路、导航页面的重算等失败后均会调用此方法
|
||
* Callback function after route calculation failure, this method will be called when route calculation on the route planning page or re-calculation on the navigation page fails
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param error 错误信息,error.code参考 AMapNaviCalcRouteState .
|
||
* Error message, error.code refer to AMapNaviCalcRouteState.
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager onCalculateRouteFailure:(NSError *_Nonnull)error;
|
||
|
||
/**
|
||
* @brief 开始导航的回调函数
|
||
* Callback function to start navigation
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param naviMode 导航类型,参考 AMapNaviMode .
|
||
* Navigation type, refer to AMapNaviMode
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager didStartNavi:(AMapNaviMode)naviMode;
|
||
|
||
/**
|
||
* @brief SDK需要实时的获取是否正在进行导航信息播报,以便SDK内部控制 "导航播报信息回调函数" 的触发时机,避免出现下一句话打断前一句话的情况. 如果需要自定义"导航语音播报"功能,必须实现此代理
|
||
* The SDK needs to obtain in real time whether navigation information is being broadcast, so that the SDK can internally control the triggering timing of the "navigation broadcast information callback function" to avoid the next sentence interrupting the previous one. If you need to customize the "navigation voice broadcast" function, this delegate must be implemented.
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @return 返回当前是否正在进行导航信息播报,如一直返回YES,"导航播报信息回调函数"就一直不会触发,如一直返回NO,就会出现语句打断情况,所以请根据实际情况返回。
|
||
* Returns whether navigation information is currently being broadcast. If it always returns YES, the "navigation broadcast callback function" will never be triggered. If it always returns NO, there will be interruption issues. Therefore, please return based on the actual situation.
|
||
*/
|
||
- (BOOL)compositeManagerIsNaviSoundPlaying:(AMapNaviCompositeManager *_Nonnull)compositeManager;
|
||
|
||
/**
|
||
* @brief 导航播报信息回调函数,此回调函数需要和compositeManagerIsNaviSoundPlaying:配合使用. 如果需要自定义"导航语音播报"功能,必须实现此代理
|
||
* Navigation broadcast information callback function, this callback function needs to be used in conjunction with compositeManagerIsNaviSoundPlaying:. If you need to customize the "navigation voice broadcast" function, you must implement this delegate
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param soundString 播报文字
|
||
* Broadcast text
|
||
* @param soundStringType 播报类型,参考 AMapNaviSoundType. 注意:since 6.0.0 AMapNaviSoundType 只返回 AMapNaviSoundTypeDefault
|
||
* Broadcast type, refer to AMapNaviSoundType. Note: since 6.0.0 AMapNaviSoundType only returns AMapNaviSoundTypeDefault
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager playNaviSoundString:(NSString *_Nullable)soundString soundStringType:(AMapNaviSoundType)soundStringType;
|
||
|
||
/**
|
||
* @brief 停止导航语音播报的回调函数,当导航SDK需要停止外部语音播报时,会调用此方法. 如果需要自定义"导航语音播报"功能,必须实现此代理
|
||
* The callback function to stop navigation voice broadcast. This method will be called when the navigation SDK needs to stop external voice broadcast. If you need to customize the "navigation voice broadcast" function, this delegate must be implemented
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
*/
|
||
- (void)compositeManagerStopPlayNaviSound:(AMapNaviCompositeManager *_Nonnull)compositeManager;
|
||
|
||
/**
|
||
* @brief 当前位置更新回调(无论是否在导航中,只要当前位置有更新就会回调)
|
||
* Current location update callback (triggered whenever the current location is updated, regardless of whether in navigation mode)
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param naviLocation 当前位置信息,参考 AMapNaviLocation 类
|
||
* Current location information, refer to AMapNaviLocation class
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager updateNaviLocation:(AMapNaviLocation *_Nullable)naviLocation;
|
||
|
||
/**
|
||
* @brief 驾车导航页面白天夜间模式切换回调 since 6.7.0
|
||
* Driving navigation page day/night mode switch callback
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param showStandardNightType 是否为夜间模式,YES 表示夜间模式,NO 表示白天模式
|
||
* Whether it is night mode, YES indicates night mode, NO indicates day mode
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager didChangeDayNightType:(BOOL)showStandardNightType;
|
||
|
||
/**
|
||
* @brief 导航到达目的地后的回调函数
|
||
* Callback function after navigation reaches the destination
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param naviMode 导航类型,参考 AMapNaviMode .
|
||
* Navigation type, refer to AMapNaviMode
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager didArrivedDestination:(AMapNaviMode)naviMode;
|
||
|
||
/**
|
||
* @brief 导航组件页面回退或者退出导航组件时会调用此函数 since 5.5.0
|
||
* This function will be called when the navigation component page goes back or exits the navigation component
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param backwardActionType 导航组件页面回退的动作类型,参考 AMapNaviCompositeVCBackwardActionType .
|
||
* The action type of the navigation component page going back, refer to AMapNaviCompositeVCBackwardActionType
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager didBackwardAction:(AMapNaviCompositeVCBackwardActionType)backwardActionType;
|
||
|
||
/**
|
||
* @brief 每次进入导航组件时和驾车路径规划策略改变均会调用此方法 since 6.1.0
|
||
* This method will be called every time entering the navigation component and when the driving route planning strategy changes
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param driveStrategy 驾车路径规划策略,参考 AMapNaviDrivingStrategy .
|
||
* Driving route planning strategy, refer to AMapNaviDrivingStrategy
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager onDriveStrategyChanged:(AMapNaviDrivingStrategy)driveStrategy;
|
||
|
||
/**
|
||
* @brief 导航到达某个途经点的回调函数 since 6.1.0
|
||
* Callback function when navigation reaches a waypoint
|
||
* @param compositeManager 导航组件类
|
||
* Navigation component class
|
||
* @param wayPointIndex 到达途径点的编号,标号从0开始. 注意:如果导航过程进行了路径重算(包含偏航、手动刷新等),wayPointIndex会重新从0开始计数
|
||
* The index of the reached waypoint, starting from 0. Note: If the route is recalculated during navigation (including deviation, manual refresh, etc.), wayPointIndex will restart counting from 0
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager onArrivedWayPoint:(int)wayPointIndex;
|
||
|
||
/**
|
||
* @brief 导航界面地图的日夜模式设置改变的回调函数. since 7.1.0
|
||
* Callback function for day-night mode setting changes in the navigation interface map
|
||
* @param type 参考 AMapNaviViewMapModeType .
|
||
* Refer to AMapNaviViewMapModeType.
|
||
*/
|
||
- (void)compositeManagerDidChangeMapViewModeType:(AMapNaviViewMapModeType)type;
|
||
|
||
/**
|
||
* @brief 导航语音播报模式设置改变的回调函数. since 7.1.0
|
||
* Callback function for navigation voice broadcast mode setting changes
|
||
* @param type 参考 AMapNaviCompositeBroadcastType .
|
||
* Refer to AMapNaviCompositeBroadcastType.
|
||
*/
|
||
- (void)compositeManagerDidChangeBroadcastType:(AMapNaviCompositeBroadcastType)type;
|
||
|
||
/**
|
||
* @brief 导航界面跟随模式设置改变的回调函数. since 7.1.0
|
||
* Callback function for navigation interface follow mode setting changes
|
||
* @param mode 参考 AMapNaviViewTrackingMode .
|
||
* Refer to AMapNaviViewTrackingMode.
|
||
*/
|
||
- (void)compositeManagerDidChangeTrackingMode:(AMapNaviViewTrackingMode)mode;
|
||
|
||
/**
|
||
* @brief 比例尺智能缩放设置改变的回调函数. since 7.1.0
|
||
* Callback function for changes in the intelligent scale zoom setting
|
||
* @param autoZoomMapLevel 锁车模式下是否为了预见下一导航动作自动缩放地图
|
||
* Whether to automatically zoom the map in car-lock mode to anticipate the next navigation action
|
||
*/
|
||
- (void)compositeManagerDidChangeAutoZoomMapLevel:(BOOL)autoZoomMapLevel;
|
||
|
||
/**
|
||
* @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 compositeManager 导航组件类
|
||
* Navigation Component Class
|
||
* @param remainServiceAreaDetails 剩余服务区列表详情
|
||
* Details of the remaining service area list
|
||
* @since 10.2.0
|
||
*/
|
||
- (void)compositeManager:(AMapNaviCompositeManager *_Nonnull)compositeManager updateRemainServiceAreaDetailInfos:(nullable NSArray<AMapNaviServiceAreaDetailInfo *> *)remainServiceAreaDetails;
|
||
|
||
@end
|
||
|