高德地图SDK(导航)  V11.3.300
AMapNaviDriveManager.h
Go to the documentation of this file.
1 //
2 // AMapNaviDriveManager.h
3 // AMapNaviKit
4 //
5 // Created by 刘博 on 16/1/12.
6 // Copyright © 2016年 Amap. All rights reserved.
7 //
8 
9 #import "AMapNaviBaseManager.h"
11 #import "AMapNaviRoute.h"
12 
13 NS_ASSUME_NONNULL_BEGIN
14 
16 
17 #pragma mark - AMapNaviDriveManager
18 
22 
23 #pragma mark - Singleton
24 
32 
39 + (BOOL)destroyInstance;
40 
45 - (instancetype)init __attribute__((unavailable("Since 5.4.0, init has been deprecated, please use the singleton [AMapNaviDriveManager sharedInstance] instead. And call [AMapNaviDriveManager destroyInstance] to destroy the singleton when calling the dealloc function of the class or at other appropriate times (such as when the navigation ViewController is popped). (Note: If the destruction fails, check if the singleton is strongly referenced)")));
46 
47 #pragma mark - Delegate
48 
51 @property (nonatomic, weak) id<AMapNaviDriveManagerDelegate> delegate;
52 
53 #pragma mark - Lane Navi
54 
62 @property (nonatomic, assign) BOOL laneNaviEnabled;
63 
64 #pragma mark - Event Listener
65 
72 - (void)addEventListener:(id<AMapNaviDriveManagerDelegate>)aListener;
73 
80 - (void)removeEventListener:(id<AMapNaviDriveManagerDelegate>)aListener;
81 
82 #pragma mark - Data Representative
83 
90 - (void)addDataRepresentative:(id<AMapNaviDriveDataRepresentable>)aRepresentative;
91 
98 - (void)removeDataRepresentative:(id<AMapNaviDriveDataRepresentable>)aRepresentative;
99 
100 #pragma mark - 轨迹还原
101 /*
102  Designated latitude and longitude of navigation endpoint
103  wayPoints - 途经点经纬度,同时支持最多16个途经点的路径规划;
104  Longitude and latitude of waypoints, supporting path planning for up to 16 waypoints simultaneously;
105 TracePoints- 轨迹点经纬度,推荐使用高德算路结果中的经纬度点,最多40000个
106  The latitude and longitude of the trajectory points are recommended to use the latitude and longitude points in the Gaode calculation results, with a maximum of 40000 points
107 vehicleType 0:燃油客车(默认值),1:燃油货车,2:纯电动客车(新能源标签默认值),3:纯电动货车,4:插电式混动客车,5:插电式混动货车,6:油车特种车辆,7:纯电动特种车辆,8:混动特种车辆,11:摩托车(油),12:摩托车(电),13:摩托车(混),17:柴油货车,18:施工作业车(定位合
108  0: Fuel powered buses (default value), 1: Fuel powered trucks, 2: Pure electric buses (default value for new energy labels), 3: Pure electric trucks, 4: Plug in hybrid buses, 5: Plug in hybrid trucks, 6: Fuel powered special vehicles, 7: Pure electric special vehicles, 8: Hybrid special vehicles, 11: Motorcycles (gasoline), 12: Motorcycles (electric), 13: Motorcycles (hybrid), 17: Diesel trucks, 18: Construction work vehicles (positioning combined)
109 */
110 + (void)pushTrajectoryRestoration:(NSArray<AMapNaviPoint *> *)wayPoints tracePoints:(NSArray<AMapNaviPoint *> *)tracePoints vehicleType:(NSInteger)vehicleType drivingStrategy:(AMapNaviDrivingStrategy)drivingStrategy resultCallback:(void(^)(BOOL isLoadSuc))resultCallback;
111 
112 #pragma mark - Navi Route
113 
116 @property (nonatomic, readonly) NSInteger naviRouteID;
117 
120 @property (nonatomic, readonly, nullable) AMapNaviRoute *naviRoute;
121 
124 @property (nonatomic, readonly, nullable) NSArray<NSNumber *> *naviRouteIDs;
125 
128 @property (nonatomic, readonly, nullable) NSDictionary<NSNumber *, AMapNaviRoute *> *naviRoutes;
129 
138 - (BOOL)selectNaviRouteWithRouteID:(NSInteger)routeID;
139 
146 - (void)switchParallelRoad:(AMapNaviParallelRoadInfo *)parallelRoadInfo;
147 
154 - (void)setMultipleRouteNaviMode:(BOOL)multipleRouteNaviMode;
155 
162 - (void)setTruckMultipleRouteNaviMode:(BOOL)multipleRouteNaviMode;
163 
164 #pragma mark - Options
165 
170 @property (nonatomic, assign) BOOL updateCameraInfo __attribute__((deprecated("Deprecated, since 10.0.820")));
171 
174 @property (nonatomic, assign) BOOL updateTrafficInfo;
175 
178 @property (nonatomic, assign) AMapNaviDetectedMode detectedMode;
179 
182 @property (nonatomic, assign, readonly) AMapNaviGPSSignalStrength gpsSignalStrength;
183 
186 @property (nonatomic, assign) NSUInteger gpsWeakDetecedInterval __attribute__((deprecated("Deprecated, since 7.8.0")));
187 
190 - (void)setIsOpenTrafficLight:(NSString *)key;
191 
192 #pragma mark - Calculate Route
193 
194 // 以下算路方法需要高德坐标(GCJ02)
195 //The following routing methods require AutoNavi coordinates(GCJ02)
196 
209 - (BOOL)calculateDriveRouteWithEndPoints:(NSArray<AMapNaviPoint *> *)endPoints
210  wayPoints:(nullable NSArray<AMapNaviPoint *> *)wayPoints
211  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
212 
227 - (BOOL)calculateDriveRouteWithStartPoints:(NSArray<AMapNaviPoint *> *)startPoints
228  endPoints:(NSArray<AMapNaviPoint *> *)endPoints
229  wayPoints:(nullable NSArray<AMapNaviPoint *> *)wayPoints
230  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
231 
251 - (BOOL)calculateDriveRouteWithStartPOIInfos:(NSArray<AMapNaviPOIInfo *> *)startPOIInfos
252  endPOIInfos:(NSArray<AMapNaviPOIInfo *> *)endPOIInfos
253  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
254  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
255 
256 
271 - (BOOL)calculateDriveRouteWithStartPointPOIId:(nullable NSString *)startPOIId
272  endPointPOIId:(nonnull NSString *)endPOIId
273  wayPointsPOIId:(nullable NSArray<NSString *> *)wayPOIIds
274  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
289 - (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
290  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
291  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
292  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
293 
294 
309 - (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
310  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
311  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
312  calRouteOptions:(nullable AMapNaviCalRouteOptions *)options;
313 
330 - (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
331  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
332  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
333  drivingStrategy:(AMapNaviDrivingStrategy)strategy
334  callback:(nullable void (^)(AMapNaviCalculateRouteResult *_Nullable routeResult))callback;
335 
353 - (BOOL)independentCalculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
354  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
355  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
356  drivingStrategy:(AMapNaviDrivingStrategy)strategy
357  callback:(nullable void (^)(AMapNaviRouteGroup *_Nullable routeGroup, NSError *_Nullable error))callback;
358 
359 
376 - (BOOL)independentCalculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
377  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
378  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
379  calRouteOptions:(nullable AMapNaviCalRouteOptions *)options
380  callback:(nullable void (^)(AMapNaviRouteGroup *_Nullable routeGroup, NSError *_Nullable error))callback;
381 
382 
391 - (BOOL)recalculateDriveRouteWithDrivingStrategy:(AMapNaviDrivingStrategy)strategy;
392 
403 - (BOOL)recalculateDriveRouteWithDrivingStrategy:(AMapNaviDrivingStrategy)strategy callback:(nullable void (^)(AMapNaviCalculateRouteResult *_Nullable routeResult))callback;
404 
405 #pragma mark - Manual
406 
415 - (void)setVehicleProvince:(NSString *)province number:(NSString *)number __attribute__((deprecated("Deprecated, please use setVehicleInfo: instead, since 6.0.0")));
416 
429 - (BOOL)setVehicleInfo:(nullable AMapNaviVehicleInfo *)vehicleInfo;
430 
439 - (BOOL)setBroadcastMode:(AMapNaviBroadcastMode)mode;
440 
449 - (BOOL)setOnlineCarHailingType:(AMapNaviOnlineCarHailingType)type;
450 
451 #pragma mark - Traffic Status
452 
463 - (nullable NSArray<AMapNaviTrafficStatus *> *)getTrafficStatusesWithStartPosition:(int)startPosition distance:(int)distance;
464 
471 - (nullable NSArray<AMapNaviTrafficStatus *> *)getTrafficStatuses;
472 
473 #pragma mark - Xcode Simulate Location
474 
481 - (void)setXcodeSimulateLocationEnable:(BOOL)enableNavi __attribute__((deprecated("Deprecated, since 7.5.0")));
482 
483 #pragma mark - 服务区详情信息 Service area details
492 - (void)setServiceAreaDetailsEnable:(BOOL)enable;
493 
494 #pragma mark - push路线相关 push route related
495 
510 - (BOOL)pushDriveRouteWithRouteGuideData:(nonnull NSData *)routeData
511  startPOIInfo:(nonnull AMapNaviPOIInfo *)startPOIInfo
512  endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
513  wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
514  drivingStrategy:(AMapNaviDrivingStrategy)strategy;
515 
516 // 5.1 算路协议升级后的路线还原接口 routeguide 协议版本号 since 9.0.0
517 // 5.1 Route restoration interface after route calculation protocol upgrade routeguide protocol version number
524 - (NSString *_Nullable)getPushDataNaviVersion;
525 
532 - (NSString *_Nullable)routeSDKVersion;
533 
540 - (NSString *_Nullable)routeServerVersion;
541 @end
542 
543 #pragma mark - Escort
544 
546 
556 - (BOOL)setEscortMissonID:(NSNumber *)missonID;
557 
558 @end
559 
560 #pragma mark - Private
561 
567 + (BOOL)setCustomCloudControlEnable:(BOOL)enable;
572 - (BOOL)setExtenalCloudControl:(nullable NSString *)cloudControlString;
573 
629 - (BOOL)getRestrictareaInfoInRoute:(AMapNaviRoute *)route callback:(nonnull void (^)(BOOL responseSuccess, NSString *responseData, NSString *errorDesc))callback;
630 
631 @end
632 
633 #pragma mark - AMapNaviDriveManagerDelegate
634 @protocol AMapNaviDriveManagerDelegate <NSObject>
635 @optional
644 - (void)driveManager:(AMapNaviDriveManager *)driveManager error:(NSError *)error;
645 
652 - (void)driveManagerOnCalculateRouteSuccess:(AMapNaviDriveManager *)driveManager;
653 
662 - (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type;
663 
674 - (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type calculateRouteResult:(AMapNaviCalculateRouteResult *)calculateRouteResult;
675 
684 - (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error;
685 
696 - (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error routePlanType:(AMapNaviRoutePlanType)type;
697 
710 - (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error routePlanType:(AMapNaviRoutePlanType)type calculateRouteResult:(AMapNaviCalculateRouteResult *)calculateRouteResult;
711 
720 - (void)driveManager:(AMapNaviDriveManager *)driveManager didStartNavi:(AMapNaviMode)naviMode;
721 
727 - (void)driveManager:(AMapNaviDriveManager *)driveManager didStopNavi:(BOOL)isStopped;
728 
735 - (void)driveManagerNeedRecalculateRouteForYaw:(AMapNaviDriveManager *)driveManager;
736 
743 - (void)driveManagerNeedRecalculateRouteForTrafficJam:(AMapNaviDriveManager *)driveManager;
744 
753 - (void)driveManager:(AMapNaviDriveManager *)driveManager onArrivedWayPoint:(int)wayPointIndex;
754 
763 - (BOOL)driveManagerIsNaviSoundPlaying:(AMapNaviDriveManager *)driveManager;
764 
775 - (void)driveManager:(AMapNaviDriveManager *)driveManager playNaviSoundString:(NSString *)soundString soundStringType:(AMapNaviSoundType)soundStringType;
776 
783 - (void)driveManagerDidEndEmulatorNavi:(AMapNaviDriveManager *)driveManager;
784 
791 - (void)driveManagerOnArrivedDestination:(AMapNaviDriveManager *)driveManager;
792 
801 - (void)driveManager:(AMapNaviDriveManager *)driveManager onNaviPlayRing:(AMapNaviRingType)ringType;
802 
811 - (void)driveManager:(AMapNaviDriveManager *)driveManager updateGPSSignalStrength:(AMapNaviGPSSignalStrength)gpsSignalStrength;
812 
821 - (void)driveManager:(AMapNaviDriveManager *)driveManager postRouteNotification:(AMapNaviRouteNotifyData *)notifyData;
822 
831 - (void)driveManager:(AMapNaviDriveManager *)driveManager onSuggestChangeMainNaviRoute:(AMapNaviSuggestChangeMainNaviRouteInfo *)suggestChangeMainNaviRouteInfo;
832 
841 - (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateDriveComfort:(AMapNaviDriveComfort *_Nonnull)driveComfort;
842 
853 - (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateDriveEvent:(AMapNaviDriveEvent *_Nonnull)driveEvent;
854 
865 - (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateNaviSpeedLimitSection:(NSInteger)speed;
866 
875 - (void)driveManager:(AMapNaviDriveManager *)driveManager onStartPlayPCMData:(nonnull AMapNaviPCMTask *)playTask;
876 
885 - (void)driveManager:(AMapNaviDriveManager *)driveManager onPlayPCMData:(nonnull AMapNaviPCMTask *)playTask;
886 
895 - (void)driveManager:(AMapNaviDriveManager *)driveManager onPCMDataFinished:(nonnull AMapNaviPCMTask *)playTask;
896 
905 - (void)driveManager:(AMapNaviDriveManager *)driveManager onTTSDrop:(nonnull AMapNaviTTSDropInfo *)dropInfo;
906 
921 - (void)driveManager:(AMapNaviDriveManager *)driveManager onPlaybackFinishedWithTaskId:(NSInteger)taskId soundType:(AMapNaviSoundType)soundType text:(nullable NSString *)text audioOutputMode:(AMapNaviAudioOutputMode)audioOutputMode;
922 
923 @end
924 
925 NS_ASSUME_NONNULL_END
AMapNaviBroadcastMode
Definition: AMapNaviCommonObj.h:309
AMapNaviGPSSignalStrength
Definition: AMapNaviCommonObj.h:378
AMapNaviOnlineCarHailingType
Definition: AMapNaviCommonObj.h:489
AMapNaviRoutePlanType
Definition: AMapNaviCommonObj.h:396
AMapNaviMode
Definition: AMapNaviCommonObj.h:57
AMapNaviDrivingStrategy
Definition: AMapNaviCommonObj.h:91
AMapNaviAudioOutputMode
Definition: AMapNaviCommonObj.h:39
AMapNaviDetectedMode
Definition: AMapNaviCommonObj.h:239
AMapNaviRingType
Definition: AMapNaviCommonObj.h:366
AMapNaviSoundType
Definition: AMapNaviCommonObj.h:228
Definition: AMapNaviDriveManager.h:545
Definition: AMapNaviDriveManager.h:562
Definition: AMapNaviBaseManager.h:26
Definition: AMapNaviCommonObj.h:1919
Definition: AMapNaviRoute.h:325
Definition: AMapNaviCommonObj.h:1458
Definition: AMapNaviCommonObj.h:1494
Definition: AMapNaviDriveManager.h:22
BOOL updateCameraInfo
Definition: AMapNaviDriveManager.h:170
NSString *_Nullable routeServerVersion()
获得 routeServer 版本号。 Get the version number of routeServer
BOOL destroyInstance()
销毁AMapNaviDriveManager单例. AMapNaviDriveManager内存开销比较大,建议不使用时可销毁. since 5.4.0 Destroy the AMapNaviDriv...
NSInteger naviRouteID
Definition: AMapNaviDriveManager.h:116
NSUInteger gpsWeakDetecedInterval
Definition: AMapNaviDriveManager.h:186
nullable NSArray< AMapNaviTrafficStatus * > * getTrafficStatuses()
获取当前道路的路况光柱信息 Get the traffic light column information of the current road
BOOL laneNaviEnabled
是否开启摩托车车道级导航,默认开启。建议在算路前设置,仅适用于摩托车,不影响驾车、货车导航。 Whether motorcycle lane-level navigation is enabled....
Definition: AMapNaviDriveManager.h:62
AMapNaviDriveManager * sharedInstance()
AMapNaviDriveManager单例。注意:如果已经获取了AMapNaviRideManager、AMapNaviWalkManager单例,需要调用对应的destroyInstance方法销毁...
instancetype init()
请使用单例替代. since 5.4.0 init已被禁止使用,请使用单例 [AMapNaviDriveManager sharedInstance] 替代,且在调用类的 dealloc 函数或其他适当...
NSDictionary< NSNumber *, AMapNaviRoute * > * naviRoutes
Definition: AMapNaviDriveManager.h:128
NSString *_Nullable routeSDKVersion()
获得 routeService 版本号。 Get the version number of routeService
AMapNaviRoute * naviRoute
Definition: AMapNaviDriveManager.h:120
BOOL updateTrafficInfo
Definition: AMapNaviDriveManager.h:174
id< AMapNaviDriveManagerDelegate > delegate
Definition: AMapNaviDriveManager.h:51
AMapNaviDetectedMode detectedMode
Definition: AMapNaviDriveManager.h:178
NSString *_Nullable getPushDataNaviVersion()
获取导航路线还原版本号。since 9.0.0 Get navigation route restoration version number
NSArray< NSNumber * > * naviRouteIDs
Definition: AMapNaviDriveManager.h:124
AMapNaviGPSSignalStrength gpsSignalStrength
Definition: AMapNaviDriveManager.h:182
Definition: AMapNaviCommonObj.h:1610
Definition: AMapNaviCommonObj.h:1353
Definition: AMapNaviCommonObj.h:1377
Definition: AMapNaviCommonObj.h:641
Definition: AMapNaviRoute.h:335
Definition: AMapNaviRoute.h:186
Definition: AMapNaviCommonObj.h:1217
Definition: AMapNaviCommonObj.h:1297
Definition: AMapNaviCommonObj.h:1639
前方交通路况信息类 Traffic condition information class ahead
Definition: AMapNaviCommonObj.h:749
Definition: AMapNaviCommonObj.h:1079
AMapNaviDriveDataRepresentable协议.实例对象可以通过实现该协议,并将其通过 AMapNaviDriveManager 的addDataRepresentative:方法进行...
Definition: AMapNaviDriveDataRepresentable.h:27
Definition: AMapNaviDriveManager.h:634
© 2017 高德信息技术有限公司 版权所有,保留所有权利。