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

885 lines
67 KiB
Objective-C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

//
// AMapNaviDriveManager.h
// AMapNaviKit
//
// Created by 刘博 on 16/1/12.
// Copyright © 2016年 Amap. All rights reserved.
//
#import "AMapNaviBaseManager.h"
#import "AMapNaviDriveDataRepresentable.h"
#import "AMapNaviRoute.h"
NS_ASSUME_NONNULL_BEGIN
@protocol AMapNaviDriveManagerDelegate;
#pragma mark - AMapNaviDriveManager
///驾车导航管理类
///Driving navigation management class
@interface AMapNaviDriveManager : AMapNaviBaseManager
#pragma mark - Singleton
/**
* @brief AMapNaviDriveManager单例。注意如果已经获取了AMapNaviRideManager、AMapNaviWalkManager单例需要调用对应的destroyInstance方法销毁单例再获取驾车导航单例。since 10.1.200。
* AMapNaviDriveManager singleton. Note: If you have already obtained the singleton instances of AMapNaviRideManager and AMapNaviWalkManager, you need to call the corresponding destroyInstance method to destroy the singletons before obtaining the driving navigation singleton.
* @return AMapNaviDriveManager实例
* AMapNaviDriveManager instance
*/
+ (AMapNaviDriveManager *)sharedInstance;
/**
* @brief 销毁AMapNaviDriveManager单例. AMapNaviDriveManager内存开销比较大建议不使用时可销毁. since 5.4.0
* Destroy the AMapNaviDriveManager singleton. AMapNaviDriveManager has a relatively large memory overhead, and it is recommended to destroy it when not in use.
* @return 是否销毁成功. 如果返回NO请检查单例是否被强引用
* Whether destruction succeeded. If NO is returned, check if the singleton is strongly referenced
*/
+ (BOOL)destroyInstance;
/**
* @brief 请使用单例替代. since 5.4.0 init已被禁止使用请使用单例 [AMapNaviDriveManager sharedInstance] 替代,且在调用类的 dealloc 函数或其他适当时机(如导航ViewController被pop时),调用 [AMapNaviDriveManager destroyInstance] 来销毁单例(需要注意如未销毁成功,请检查单例是否被强引用)
* Please use a singleton instead. 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)
*/
- (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)")));
#pragma mark - Delegate
///实现了 AMapNaviDriveManagerDelegate 协议的类指针
///A class pointer implementing the AMapNaviDriveManagerDelegate protocol
@property (nonatomic, weak) id<AMapNaviDriveManagerDelegate> delegate;
#pragma mark - Event Listener
/**
* @brief 增加用于接收导航回调事件的Listener, 效果等同于delegate. 注意:该方法不会增加实例对象的引用计数(Weak Reference). since 5.4.0
* Adds a Listener to receive navigation callback events, functionally equivalent to a delegate. Note: This method does not increment the reference count of the instance object (Weak Reference)
* @param aListener 实现了 AMapNaviDriveManagerDelegate 协议的实例
* An instance that implements the AMapNaviDriveManagerDelegate protocol
*/
- (void)addEventListener:(id<AMapNaviDriveManagerDelegate>)aListener;
/**
* @brief 移除用于接收导航回调事件的Listener. since 5.4.0
* Remove the Listener used to receive navigation callback events
* @param aListener 实现了 AMapNaviDriveManagerDelegate 协议的实例
* An instance that implements the AMapNaviDriveManagerDelegate protocol
*/
- (void)removeEventListener:(id<AMapNaviDriveManagerDelegate>)aListener;
#pragma mark - Data Representative
/**
* @brief 增加用于展示导航数据的DataRepresentative.注意:该方法不会增加实例对象的引用计数(Weak Reference)
* Add a DataRepresentative for displaying navigation data. Note: This method will not increase the reference count of the instance object (Weak Reference)
* @param aRepresentative 实现了 AMapNaviDriveDataRepresentable 协议的实例
* An instance that implements the AMapNaviDriveDataRepresentable protocol
*/
- (void)addDataRepresentative:(id<AMapNaviDriveDataRepresentable>)aRepresentative;
/**
* @brief 移除用于展示导航数据的DataRepresentative
* Remove the DataRepresentative used to display navigation data
* @param aRepresentative 实现了 AMapNaviDriveDataRepresentable 协议的实例
* An instance that implements the AMapNaviDriveDataRepresentable protocol
*/
- (void)removeDataRepresentative:(id<AMapNaviDriveDataRepresentable>)aRepresentative;
#pragma mark - 轨迹还原
/*
Designated latitude and longitude of navigation endpoint
wayPoints - 途经点经纬度同时支持最多16个途经点的路径规划
Longitude and latitude of waypoints, supporting path planning for up to 16 waypoints simultaneously;
TracePoints- 轨迹点经纬度推荐使用高德算路结果中的经纬度点最多40000个
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
vehicleType 0燃油客车默认值1燃油货车2纯电动客车新能源标签默认值3纯电动货车4插电式混动客车5插电式混动货车6油车特种车辆7纯电动特种车辆8混动特种车辆11摩托车12摩托车13摩托车17柴油货车18施工作业车定位合
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)
*/
+ (void)pushTrajectoryRestoration:(NSArray<AMapNaviPoint *> *)wayPoints tracePoints:(NSArray<AMapNaviPoint *> *)tracePoints vehicleType:(NSInteger)vehicleType drivingStrategy:(AMapNaviDrivingStrategy)drivingStrategy resultCallback:(void(^)(BOOL isLoadSuc))resultCallback;
#pragma mark - Navi Route
///当前导航路径的ID
///The ID of the current navigation path
@property (nonatomic, readonly) NSInteger naviRouteID;
///当前导航路径的信息,参考 AMapNaviRoute 类.
///The information of the current navigation path, refer to the AMapNaviRoute class.
@property (nonatomic, readonly, nullable) AMapNaviRoute *naviRoute;
///多路径规划时的所有路径ID,路径ID为 NSInteger 类型.
///All route IDs during multi-route planning, the route ID is of NSInteger type
@property (nonatomic, readonly, nullable) NSArray<NSNumber *> *naviRouteIDs;
///多路径规划时的所有路径信息,参考 AMapNaviRoute 类.
///All route information during multi-route planning, refer to the AMapNaviRoute class.
@property (nonatomic, readonly, nullable) NSDictionary<NSNumber *, AMapNaviRoute *> *naviRoutes;
/**
* @brief 多路径规划时选择路径.注意:该方法仅限于在开始导航前使用,开始导航后该方法无效.
* Selecting a route during multi-route planning. Note: This method is only available before starting navigation and becomes invalid after navigation starts
* @param routeID 路径ID
* Route ID
* @return 是否选择路径成功
* Whether the route selection is successful
*/
- (BOOL)selectNaviRouteWithRouteID:(NSInteger)routeID;
/**
* @brief 切换平行道路, 包括主辅路切换、高架上下切换. 该方法需要配合 AMapNaviDriveDataRepresentable 的 driveManager:updateParallelRoadStatus: 回调使用. since 5.3.0
* Switch parallel roads, including main/auxiliary road switching and elevated road level switching. This method needs to be used with the driveManager:updateParallelRoadStatus: callback of AMapNaviDriveDataRepresentable
* @param parallelRoadInfo 平行路切换信息,参考 AMapNaviParallelRoadInfo.
* Parallel road switching information, refer to AMapNaviParallelRoadInfo.
*/
- (void)switchParallelRoad:(AMapNaviParallelRoadInfo *)parallelRoadInfo;
/**
* @brief 设置多路线导航模式(实时导航中拥有若干条备选路线供用户选择), 或单路线导航模式(默认模式). 注意: 1、设置的导航模式会在下一次主动路径规划时生效, 建议在 AMapNaviDriveManager 单例初始化时就进行设置. 2、多路线导航模式还需同时满足以下4个条件才能够生效a.路径规划时 AMapNaviDrivingStrategy 需选用多路径策略; b.起终点的直线距离需<=80KM; c.不能有途径点; d.车辆不能是货车类型. since 6.3.0
* Set multi-route navigation mode (providing several alternative routes for users to choose from during real-time navigation), or single-route navigation mode (default mode). Note: 1. The set navigation mode will take effect the next time active route planning is initiated. It is recommended to set it during the initialization of the AMapNaviDriveManager singleton. 2. The multi-route navigation mode also needs to meet the following 4 conditions to take effect: a. When planning the route, AMapNaviDrivingStrategy needs to adopt the multi-path strategy; b. The straight-line distance between the start and end points must be <=80KM; c. There should be no waypoints; d. The vehicle type must not be a truck.
* @param multipleRouteNaviMode YES:多路线导航模式, NO:单路线导航模式(默认)
* YES: Multi-route navigation mode, NO: Single-route navigation mode (default)
*/
- (void)setMultipleRouteNaviMode:(BOOL)multipleRouteNaviMode;
/**
* @brief 设置货车多路线导航模式(导航中拥有若干条备选路线供用户选择), 或单路线导航模式(默认模式)。建议在 AMapNaviDriveManager 单例初始化时就进行设置。注意此方法仅限于在开始导航前调用有效以下情况不会出现多备选路线模拟导航、路线存在途经点、路线长度超过80KM。特别注意当前接口为收费接口您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/。since 9.3.5
* Set truck multi-route navigation mode (with several alternative routes available for users to choose during navigation), or single-route navigation mode (default mode). It is recommended to set this during the initialization of the AMapNaviDriveManager singleton. Note: This method is only effective when called before starting navigation. Multiple alternative routes will not be available in the following cases: simulated navigation, routes with waypoints, or routes exceeding 80KM in length. 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/
* @param multipleRouteNaviMode YES:多路线导航模式, NO:单路线导航模式. 默认为NO.
* YES: Multi-route navigation mode, NO: Single-route navigation mode. Default is NO.
*/
- (void)setTruckMultipleRouteNaviMode:(BOOL)multipleRouteNaviMode;
#pragma mark - Options
///导航中是否播报交通信息,默认YES(需要联网).
///Whether to announce traffic information during navigation, default YES (requires internet connection)
///导航中是否播报摄像头信息,默认YES. 调用此接口无效
///Whether to announce camera information during navigation, default is YES. Calling this interface is invalid.
@property (nonatomic, assign) BOOL updateCameraInfo __attribute__((deprecated("Deprecated, since 10.0.820")));
///是否播报交通信息,默认YES(需要联网). 注意:关闭后,巡航模式 不会播放相关信息; 打开后,不设置巡航模块也会播放前方拥堵信息; 导航和巡航的播报是互斥的,导航中,不会有巡航的播报
///Whether to broadcast traffic information, default is YES (requires internet connection) Attention: After being turned off, the cruise mode will not play relevant information; After opening, even without setting the cruise control module, congestion information ahead will still be played; Navigation and cruise broadcasts are mutually exclusive, and there will be no cruise broadcast in navigation
@property (nonatomic, assign) BOOL updateTrafficInfo;
///巡航模式,默认为 AMapNaviDetectedModeNone. 注意1. 如果已经处在导航模式,要开启巡航模式时,需要先调用 stopNavi 来停止导航,再设置 detectedMode 才能生效 2.如果已经处于巡航模式要开启导航前需要先调用setDetectedMode(AMapNaviDetectedModeNone) 来关闭巡航,再开启导航
///Cruise mode, Default is AMapNaviDetectedModeNone. Note: 1. If already in navigation mode, to enable cruise mode, you need to first call stopNavi to stop navigation, and then set detectedMode for it to take effect. 2. If already in cruise mode, before starting navigation, you need to first call setDetectedMode(AMapNaviDetectedModeNone) to turn off cruise mode, then start navigation.
@property (nonatomic, assign) AMapNaviDetectedMode detectedMode;
///卫星定位信号强度类型, 参考 AMapNaviGPSSignalStrength since 7.8.0 只在导航中获取卫星定位信号强弱的值才有效
///Satellite Positioning Signal Strength Type, refer to AMapNaviGPSSignalStrength; since 7.8.0, only valid when obtaining GPS signal strength values during navigation
@property (nonatomic, assign, readonly) AMapNaviGPSSignalStrength gpsSignalStrength;
///默认为10, 范围为[ 5, 15 ], 单位秒. 表示有连续的10s, 定位信号质量都比较差, 就会触发手机卫星定位信号弱的回调. 值越小, 就越容易触发. since 6.6.0
///Default is 10, range is [5, 15], unit in seconds. It means if the positioning signal quality remains poor for 10 continuous seconds, the callback for weak satellite positioning signal on the phone will be triggered. The smaller the value, the easier it is to trigger.
@property (nonatomic, assign) NSUInteger gpsWeakDetecedInterval __attribute__((deprecated("Deprecated, since 7.8.0")));
///设置是否显示红绿灯倒计时。since 10.0.700
///Set whether to display traffic light countdown
- (void)setIsOpenTrafficLight:(NSString *)key;
#pragma mark - Calculate Route
// 以下算路方法需要高德坐标(GCJ02)
//The following routing methods require AutoNavi coordinates(GCJ02)
/**
* @brief 不带起点的驾车路径规划
* Driving route planning without starting point
* @param endPoints 终点坐标.终点列表的尾点为实时导航终点.
* Destination coordinates. The last point in the destination list is the real-time navigation destination
* @param wayPoints 途经点坐标,最多支持16个途经点. 超过16个会取前16个.
* Waypoint coordinates, up to 16 waypoints are supported. If more than 16, the first 16 will be taken
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)calculateDriveRouteWithEndPoints:(NSArray<AMapNaviPoint *> *)endPoints
wayPoints:(nullable NSArray<AMapNaviPoint *> *)wayPoints
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 带起点的驾车路径规划
* Driving route planning with starting point
* @param startPoints 起点坐标.起点列表的尾点为实时导航起点,其他坐标点为辅助信息,带有方向性,可有效避免算路到马路的另一侧.
* Starting coordinates. The last point in the starting list is the real-time navigation starting point, other coordinate points are auxiliary information, with directionality, which can effectively avoid routing to the other side of the road
* @param endPoints 终点坐标.终点列表的尾点为实时导航终点,其他坐标点为辅助信息,带有方向性,可有效避免算路到马路的另一侧.
* Ending coordinates. The last point in the ending list is the real-time navigation ending point, other coordinate points are auxiliary information, with directionality, which can effectively avoid routing to the other side of the road
* @param wayPoints 途经点坐标,最多支持16个途经点. 超过16个会取前16个
* Waypoint coordinates, up to 16 waypoints are supported. If more than 16, the first 16 will be taken
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)calculateDriveRouteWithStartPoints:(NSArray<AMapNaviPoint *> *)startPoints
endPoints:(NSArray<AMapNaviPoint *> *)endPoints
wayPoints:(nullable NSArray<AMapNaviPoint *> *)wayPoints
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 多起点多终点的驾车路径规划注意AMapNaviPOIInfo中,如果POIID合法,优先使用ID参与算路,否则使用其坐标点. 注意:POIID和坐标点不能同时为空
* Multi-origin and multi-destination driving route planning. Note: In AMapNaviPOIInfo, if the POIID is valid, the ID will be prioritized for route calculation; otherwise, its coordinates will be used. Note: POIID and coordinates cannot both be empty.
* @param startPOIInfos 起点列表.起点列表的尾点为实时导航起点(如果为POI算路仅最后一个点的mid不空即可)
* 其他坐标点为辅助信息,带有方向性,可有效避免算路到马路的另一侧.
* Starting point list. The last point in the starting point list is the real-time navigation starting point (if it is POI routing, only the mid of the last point needs to be non-empty).
* Other coordinate points serve as auxiliary information with directionality, effectively preventing route calculation to the opposite side of the road.
* @param endPOIInfos 终点列表.终点列表的尾点为实时导航终点(如果为POI算路仅最后一个点的mid不空即可)
* 其他坐标点为辅助信息,带有方向性,可有效避免算路到马路的另一侧..
* Destination list. The last point in the destination list is the real-time navigation endpoint (if it's POI routing, only the mid of the last point needs to be non-empty),
* Other coordinate points serve as auxiliary information, with directionality, effectively preventing route calculation to the opposite side of the road..
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个.
* The POIIinfo waypoint supports up to 16 waypoints, and if there are more than 16, the top 16 will be selected
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* For route calculation strategy, it is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [AutoNavi Map] (avoid congestion + prioritize speed + avoid tolls)
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
*Whether the conditions and parameters required for route planning are successfully validated does not indicate the success of the route calculation.
* @since 10.0.720
*/
- (BOOL)calculateDriveRouteWithStartPOIInfos:(NSArray<AMapNaviPOIInfo *> *)startPOIInfos
endPOIInfos:(NSArray<AMapNaviPOIInfo *> *)endPOIInfos
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 根据高德POIId进行驾车路径规划,为了保证路径规划的准确性,请尽量使用此方法. since 6.1.0
* Plan driving routes based on Amap POIId. To ensure route planning accuracy, please try to use this method
* @param startPOIId 起点POIId,如果以“我的位置”作为起点,请传nil
* Starting point POIId, if using 'My Location' as the starting point, please pass nil
* @param endPOIId 终点POIId,必填
* Destination POIId, required
* @param wayPOIIds 途经点POIId,最多支持16个途经点. 超过16个会取前16个
* Waypoint POIId, up to 16 waypoints are supported. If more than 16, the first 16 will be taken
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)calculateDriveRouteWithStartPointPOIId:(nullable NSString *)startPOIId
endPointPOIId:(nonnull NSString *)endPOIId
wayPointsPOIId:(nullable NSArray<NSString *> *)wayPOIIds
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 根据高德POIInfo进行驾车路径规划,为了保证路径规划的准确性,请尽量使用此方法. since 6.4.0
* Plan the driving route based on Amap POIInfo. To ensure the accuracy of the route planning, please try to use this method.
* @param startPOIInfo 起点POIInfo,参考 AMapNaviPOIInfo. 如果以“我的位置”作为起点,请传nil. 如果startPOIInfo不为nil,那么POIID合法,优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo,参考 AMapNaviPOIInfo. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Waypoint POIInfo, up to 16 waypoints are supported. If more than 16, the first 16 will be taken. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 根据高德POIInfo进行驾车路径规划. 可以自定义AMapNaviCalRouteOptions参数 since 10.1.0
* Perform driving route planning based on AutoNavi POIInfo. Customizable AMapNaviCalRouteOptions parameters since version 10.1.0
* @param startPOIInfo 起点POIInfo,参考 AMapNaviPOIInfo. 如果以“我的位置”作为起点,请传nil. 如果startPOIInfo不为nil,那么POIID合法,优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo,参考 AMapNaviPOIInfo. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Waypoint POIInfo, supports up to 16 waypoints, exceeding 16 will take the first 16. If the POIID is valid, the ID will be used for route calculation first, otherwise the coordinate point will be used. Note: POIID and coordinate point cannot both be empty.
* @param options AMapNaviCalRouteOptions 传nil时使用AMapNaviCalRouteOptions声明中的默认值
* When AMapNaviCalRouteOptions pass nil, use the default value in the AMapNaviCalRouteOptions declaration
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* Whether the conditions and parameters required for route planning are successfully validated does not indicate the success of the route calculation.
*/
- (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
calRouteOptions:(nullable AMapNaviCalRouteOptions *)options;
/**
* @brief 根据高德POIInfo进行驾车路径规划,为了保证路径规划的准确性,请尽量使用此方法. since 10.1.111
* Plan the driving route based on Amap POIInfo. To ensure the accuracy of the route planning, please try to use this method.
* @param startPOIInfo 起点POIInfo,参考 AMapNaviPOIInfo. 如果以“我的位置”作为起点,请传nil. 如果startPOIInfo不为nil,那么POIID合法,优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo,参考 AMapNaviPOIInfo. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Waypoint POIInfo, up to 16 waypoints are supported. If more than 16, the first 16 will be taken. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @param callback 算路结果回调。一次算路routeResult 中的 routeRequestId 与 算路成功、算路失败接口中返回的 routeRequestId 一致
* Routing result callback. For a single routing request, the routeRequestId in routeResult matches the routeRequestId returned by both the successful and failed routing interfaces.
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)calculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
drivingStrategy:(AMapNaviDrivingStrategy)strategy
callback:(nullable void (^)(AMapNaviCalculateRouteResult *_Nullable routeResult))callback;
/**
* @brief 独立算路能力接口,可用于不干扰本次导航的单独算路场景. since 7.7.0
* Independent route calculation capability interface, can be used for separate route calculation scenarios without interfering with the current navigation. since 10.3.0
* Independent routing capability interface, can be used for separate routing scenarios without interfering with current navigation
* @param startPOIInfo 起点POIInfo,参考 AMapNaviPOIInfo. 如果以“我的位置”作为起点,请传nil. 如果startPOIInfo不为nil,那么POIID合法,优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo,参考 AMapNaviPOIInfo. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Waypoint POIInfo, up to 16 waypoints are supported. If more than 16, the first 16 will be taken. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @param callback 算路完成的回调. 算路成功时routeGroup 不为空算路失败时error 不为空error.code参照 AMapNaviCalcRouteState.
* Callback for route calculation completion. When the route calculation is successful, routeGroup is not empty; when it fails, error is not empty, and error.code refers to AMapNaviCalcRouteState.
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* The success of validating the conditions and parameters required for route planning does not indicate the success of route calculation
*/
- (BOOL)independentCalculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
drivingStrategy:(AMapNaviDrivingStrategy)strategy
callback:(nullable void (^)(AMapNaviRouteGroup *_Nullable routeGroup, NSError *_Nullable error))callback;
/**
* @brief 独立算路能力接口,可用于不干扰本次导航的单独算路场景. since 10.3.0
* @param startPOIInfo 起点POIInfo,参考 AMapNaviPOIInfo. 如果以“我的位置”作为起点,请传nil. 如果startPOIInfo不为nil,那么POIID合法,优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo,参考 AMapNaviPOIInfo. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个. 如果POIID合法,优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Waypoint POIInfo, supports up to 16 waypoints, exceeding 16 will take the first 16. If the POIID is valid, the ID will be used for route calculation first, otherwise the coordinate point will be used. Note: POIID and coordinate point cannot both be empty.
* @param options AMapNaviCalRouteOptions 传nil时使用AMapNaviCalRouteOptions声明中的默认值
* When passing nil for AMapNaviCalRouteOptions, use the default values declared in AMapNaviCalRouteOptions
* @param callback 算路完成的回调. 算路成功时routeGroup 不为空算路失败时error 不为空error.code参照 AMapNaviCalcRouteState.
* Callback for route calculation completion. When the route calculation is successful, routeGroup is not empty; when it fails, error is not empty, and error.code refers to AMapNaviCalcRouteState.
* @return 规划路径所需条件和参数校验是否成功,不代表算路成功与否
* Whether the conditions and parameters required for route planning are successfully validated does not indicate the success of the route calculation.
*
*/
- (BOOL)independentCalculateDriveRouteWithStartPOIInfo:(nullable AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
calRouteOptions:(nullable AMapNaviCalRouteOptions *)options
callback:(nullable void (^)(AMapNaviRouteGroup *_Nullable routeGroup, NSError *_Nullable error))callback;
/**
* @brief 导航过程中重新规划路径(起点为当前位置,途经点和终点位置不变)
* Re-plan the route during navigation (starting from the current position, with the waypoints and destination unchanged)
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @return 重新规划路径所需条件和参数校验是否成功, 不代表算路成功与否, 如非导航状态下调用此方法会返回NO.
* The successful validation of conditions and parameters required for re-planning does not guarantee successful route calculation. Calling this method outside of navigation mode will return NO.
*/
- (BOOL)recalculateDriveRouteWithDrivingStrategy:(AMapNaviDrivingStrategy)strategy;
/**
* @brief 导航过程中重新规划路径(起点为当前位置,途经点和终点位置不变)。since 10.1.111
* Re-plan the route during navigation (starting from the current position, with the waypoints and destination unchanged)
* @param strategy 路径的计算策略,建议使用 AMapNaviDrivingStrategyMultipleDefault与[高德地图]默认策略一致 (避让拥堵+速度优先+避免收费)
* The route calculation strategy is recommended to use AMapNaviDrivingStrategyMultipleDefault, which is consistent with the default strategy of [Gaode Map] (avoid congestion + speed priority + avoid tolls)
* @param callback 算路结果回调。一次算路routeResult 中的 routeRequestId 与 算路成功、算路失败接口中返回的 routeRequestId 一致
* Routing result callback. For a single routing request, the routeRequestId in routeResult matches the routeRequestId returned by both the successful and failed routing interfaces.
* @return 重新规划路径所需条件和参数校验是否成功, 不代表算路成功与否, 如非导航状态下调用此方法会返回NO.
* The successful validation of conditions and parameters required for re-planning does not guarantee successful route calculation. Calling this method outside of navigation mode will return NO.
*/
- (BOOL)recalculateDriveRouteWithDrivingStrategy:(AMapNaviDrivingStrategy)strategy callback:(nullable void (^)(AMapNaviCalculateRouteResult *_Nullable routeResult))callback;
#pragma mark - Manual
/**
* @brief 设置车牌信息. 已废弃,请使用 setVehicleInfo: 替代since 6.0.0
* Set license plate information. Deprecated, please use setVehicleInfo: instead
* @param province 车牌省份缩写,例如:"京"
* License plate province abbreviation, for example: "Jing"
* @param number 除省份及标点之外,车牌的字母和数字,例如:"NH1N11"
* Letters and numbers of the license plate except for the province and punctuation, for example: "NH1N11"
*/
- (void)setVehicleProvince:(NSString *)province number:(NSString *)number __attribute__((deprecated("Deprecated, please use setVehicleInfo: instead, since 6.0.0")));
/**
* @brief 设置车辆信息. since 6.0.0
* Set license plate information
* @param vehicleInfo 车辆信息,参考 AMapNaviVehicleInfo. 如果要清空已设置的车辆信息传入nil即可.
* Vehicle information, refer to AMapNaviVehicleInfo. To clear the set vehicle information, pass nil
* @return 是否设置成功
* Whether the setup is successful
*/
- (BOOL)setVehicleInfo:(nullable AMapNaviVehicleInfo *)vehicleInfo;
/**
* @brief 设置播报模式. 注意:如果在导航过程中设置,需要在下次算路后才能起作用,如偏航重算、手动刷新后.
* Set broadcast mode. Note: If set during navigation, it will take effect after the next route calculation, such as rerouting after deviation or manual refresh
* @param mode 参考 AMapNaviBroadcastMode . 默认新手详细播报( AMapNaviBroadcastModeDetailed )
* Refer to AMapNaviBroadcastMode. Default is detailed broadcast for beginners.( AMapNaviBroadcastModeDetailed )
* @return 是否成功
* Whether successful
*/
- (BOOL)setBroadcastMode:(AMapNaviBroadcastMode)mode;
/**
* @brief 设置网约车模式. since 6.4.0
* Set ride-hailing mode
* @param type 参考 AMapNaviOnlineCarHailingType. 默认为 AMapNaviOnlineCarHailingTypeNone (非网约车模式, 即正常模式)
* Refer to AMapNaviOnlineCarHailingType. Default is AMapNaviOnlineCarHailingTypeNone.(Non-ride-hailing mode, i.e., normal mode)
* @return 是否设置成功
* Whether the setup is successful
*/
- (BOOL)setOnlineCarHailingType:(AMapNaviOnlineCarHailingType)type;
#pragma mark - Traffic Status
/**
* @brief 获取某一范围内的路况光柱信息
* Obtain traffic light pillar information within a certain range
* @param startPosition 光柱范围在路径中的起始位置,取值范围[0, routeLength)
* Starting position of the light pillar range in the path, value range [0, routeLength)
* @param distance 光柱范围的距离,startPosition + distance 和的取值范围(0, routelength]
* The distance of the light beam range, the value range of startPosition + distance is (0, routelength]
* @return 该范围内路况信息数组,可用于绘制光柱,参考 AMapNaviTrafficStatus 类.
* The traffic information array within this range can be used to draw the light beam, refer to class AMapNaviTrafficStatus.
*/
- (nullable NSArray<AMapNaviTrafficStatus *> *)getTrafficStatusesWithStartPosition:(int)startPosition distance:(int)distance;
/**
* @brief 获取当前道路的路况光柱信息
* Get the traffic light column information of the current road
* @return 该范围内路况信息数组,可用于绘制光柱,参考 AMapNaviTrafficStatus 类.
* The traffic information array within this range can be used to draw light columns, refer to class AMapNaviTrafficStatus.
*/
- (nullable NSArray<AMapNaviTrafficStatus *> *)getTrafficStatuses;
#pragma mark - Xcode Simulate Location
/**
* @brief 设置Xcode模拟定位点是否参与导航. 注意:此方法仅供开发者调试使用. since 6.7.0
* Set whether the Xcode simulated location point participates in navigation. Note: This method is for developer debugging only.
* @param enableNavi 模拟的定位点是否参与导航, 默认为NO.
* Whether simulated location points participate in navigation, default is NO
*/
- (void)setXcodeSimulateLocationEnable:(BOOL)enableNavi __attribute__((deprecated("Deprecated, since 7.5.0")));
#pragma mark - 服务区详情信息 Service area details
/**
* @brief 设置是否打开服务区详情信息. since 8.0.0
* Setting whether to enable service area details
* 注意从10.1.0版本开始,使用@property (nonatomic, assign) AMapNaviSecureFeature secureFeature;方法打开服务区详情高级功能后,该开关也会默认被打开
* Note: Starting from version 10.1.0, use @ property (non atomic, assign) AMapNaviSecureFeature secureFeature; After opening the advanced function of the service area details, the switch will also be turned on by default
* @param enable 请求服务详情信息的功能是否打开, 默认为NO.
* Whether the function to request service details is enabled, default is NO.
*/
- (void)setServiceAreaDetailsEnable:(BOOL)enable;
#pragma mark - push路线相关 push route related
/**
* @brief 路线还原接口。since 9.0.0
* Route restore interface
* @param startPOIInfo 起点POIInfo参考 AMapNaviPOIInfo。如果以“我的位置”作为起点,请传nil。 如果startPOIInfo不为nil,那么POIID合法优先使用ID参与算路,否则使用坐标点.
* Starting POIInfo, refer to AMapNaviPOIInfo. If 'My Location' is used as the starting point, please pass nil. If startPOIInfo is not nil, then the POIID is valid, and the ID is prioritized for route calculation; otherwise, the coordinate point is used.
* @param endPOIInfo 终点POIInfo参考 AMapNaviPOIInfo。如果POIID合法优先使用ID参与算路,否则使用坐标点. 注意:POIID和坐标点不能同时为空
* Destination POIInfo, refer to AMapNaviPOIInfo. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param wayPOIInfos 途经点POIInfo,最多支持16个途经点,超过16个会取前16个。如果POIID合法,优先使用ID参与算路,否则使用坐标点。 注意:POIID和坐标点不能同时为空。
* Waypoint POIInfo, up to 16 waypoints are supported. If more than 16, the first 16 will be taken. If the POIID is valid, use the ID for route calculation first; otherwise, use the coordinate point. Note: POIID and coordinate point cannot both be empty.
* @param strategy 路径的计算策略。
* Route calculation strategy
* @return 路线还原是否成功。
* Whether route restoration is successful
*/
- (BOOL)pushDriveRouteWithRouteGuideData:(nonnull NSData *)routeData
startPOIInfo:(nonnull AMapNaviPOIInfo *)startPOIInfo
endPOIInfo:(nonnull AMapNaviPOIInfo *)endPOIInfo
wayPOIInfos:(nullable NSArray<AMapNaviPOIInfo *> *)wayPOIInfos
drivingStrategy:(AMapNaviDrivingStrategy)strategy;
// 5.1 算路协议升级后的路线还原接口 routeguide 协议版本号 since 9.0.0
// 5.1 Route restoration interface after route calculation protocol upgrade routeguide protocol version number
/**
* @brief 获取导航路线还原版本号。since 9.0.0
* Get navigation route restoration version number
* @return routeguide 协议版本号。
* Routeguide protocol version number
*/
- (NSString *_Nullable)getPushDataNaviVersion;
/**
* @brief 获得 routeService 版本号。
* Get the version number of routeService
* @return routeService 协议版本号。
* RouteService protocol version number
*/
- (NSString *_Nullable)routeSDKVersion;
/**
* @brief 获得 routeServer 版本号。
* Get the version number of routeServer
* @return routeServer 协议版本号。
* RouteServer protocol version number
*/
- (NSString *_Nullable)routeServerVersion;
@end
#pragma mark - Escort
@interface AMapNaviDriveManager (Escort)
/**
* 设置一路护航任务id. 注意:此方法必须在"开始算路"之前设置, 否则无效, since 6.7.0
* Set the escort task ID. Note: This method must be set before "start routing", otherwise it will be invalid
* @brief 设置一路护航任务id. 注意:此方法必须在"开始算路"之前设置, 否则无效, since 6.7.0
* @param missonID 一路护航的任务id
* The task ID of the escort
* @return 是否设置成功
* Whether the setting is successful
*/
- (BOOL)setEscortMissonID:(NSNumber *)missonID;
@end
#pragma mark - Private
@interface AMapNaviDriveManager (Private)
/**
* @brief 私有静态方法,外部禁止调用. since 7.8.0
* Private static methods, external calls are prohibited
*/
+ (BOOL)setCustomCloudControlEnable:(BOOL)enable;
/**
* @brief 私有实例接口,外部禁止调用. since 7.8.0
* Private instance interfaces, external calls are prohibited
*/
- (BOOL)setExtenalCloudControl:(nullable NSString *)cloudControlString;
/**
* @brief 获取限行数据接口. 注意:当前接口为付费接口,使用当前接口需要 官网联系https://lbs.amap.com/ 商务 since 9.0.1
* API for obtaining traffic restriction data. Note: This is a paid interface, to use it please contact the official website https://lbs.amap.com/ for business inquiries
* @param callback 获取限行数据的回调. success 代表是否获取限行数据成功获取限行数据成功时responseData 不为空获取限行数据失败时errorDesc 不为空.
* Callback for retrieving traffic restriction data. 'success' indicates whether the traffic restriction data was successfully obtained. When the data is successfully obtained, 'responseData' is not empty; when the data acquisition fails, 'errorDesc' is not empty.
*1. success 为true response成功时返回结构体
*When success is true, the response returns a structure
{
"code": 1, ----code的value 为 1 请求限行数据成功 The value of code is 1, indicating a successful request for traffic restriction data
"citynums": 1,
"citys": [{
"citycode": 000,
"rulenums": 1,
"cityname": "XX市",
"title": "XXX限行政策",
"rules": [{
"ruleid": 1766888,
"ring": 0,
"effect": 1,
"local": 2,
"vehicle": 1,
"time": "全天限行",
"policyname": "二环及以内外地机动车限行",
"summary": "二环路及以内道路(不含外侧辅路)",
"desc": "2021年11月1日起外地全部机动车限行",
"otherdesc": "",
"centerpoint": "116.397451,39.909060",
"linepoints": "",
"areapoints": ""。
}]
}]
}
code
code的value 为 1 请求限行数据成功, code 为value 非1值则代表限行数据服务返回失败
If the value of code is 1, the request for traffic restriction data is successful; if the value of code is not 1, it indicates that the traffic restriction data service has failed.
areapoints
1.在同一限行区域存在一个限行多边形时,限行数据为经度和纬度使用逗号(,)隔开,多个经纬度使用分号(;)隔开;
When there is a restricted polygon in the same restricted area, the restricted data is separated by a comma (,) for longitude and latitude, and multiple longitude and latitude coordinates are separated by a semicolon (;)
example一个多边形数据:
|---------------- 多边形1--------------------| 每一个多边形对应一个polygon
example: a polygon data
|---------------- Polygon1--------------------| Each polygon corresponds to one polygon
lon1,lat1;lon2,lat2;lon3,lat3;lon4,lat4;
2.在同一限行区域存在多个限行多边形时,多个多边形之间的数据使用竖线 (|) 隔开;
When multiple restricted polygons exist in the same restricted area, the data between multiple polygons is separated by a vertical bar (|)
example3个多边形数据:
|---------------- 多边形1--------------------| |----------- 多边形2-----------| |----------- 多边形3-----------|
example: 3 polygon data:
|---------------- Polygon1--------------------| |----------- Polygon2-----------| |----------- Polygon3-----------|
lon1,lat1;lon2,lat2;lon3,lat3;lon4,lat4| lon5,lat5;lon6,lat6;lon7,lat7| lon8,lat8;lon9,lat9;lon10,lat10
* 2.success 为false response为空errorDesc为返回的错误描述
* success is false, response is empty, errorDesc is the returned error description
* @return 获取限行条件是否满足;路线上数据不为空,且路线上有限行信息则返回YES否则的话则返回NO不代表获取限行数据成功与否
* Check if the traffic restriction conditions are met; if the route data is not empty and contains traffic restriction information, return YES; otherwise return NO; this does not indicate whether the traffic restriction data was successfully obtained
*/
- (BOOL)getRestrictareaInfoInRoute:(AMapNaviRoute *)route callback:(nonnull void (^)(BOOL responseSuccess, NSString *responseData, NSString *errorDesc))callback;
@end
#pragma mark - AMapNaviDriveManagerDelegate
@protocol AMapNaviDriveManagerDelegate <NSObject>
@optional
/**
* @brief 发生错误时,会调用代理的此方法
* When an error occurs, this method of the delegate will be called
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param error 错误信息
* Error message
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager error:(NSError *)error;
/**
* @brief 驾车路径规划成功后的回调函数,请尽量使用 -driveManager:onCalculateRouteSuccessWithType: 替代此方法
* Callback function after successful driving route planning, please try to use -driveManager:onCalculateRouteSuccessWithType: instead of this method
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManagerOnCalculateRouteSuccess:(AMapNaviDriveManager *)driveManager;
/**
* @brief 驾车路径规划成功后的回调函数 since 6.1.0
* Callback function after successful driving route planning
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param type 路径规划类型,参考 AMapNaviRoutePlanType
* Route planning type, refer to AMapNaviRoutePlanType
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type;
/**
* @brief 驾车路径规划成功后的回调函数 since 10.1.111
* Callback function after successful driving route planning
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param type 路径规划类型,参考 AMapNaviRoutePlanType
* Route planning type, refer to AMapNaviRoutePlanType
* @param calculateRouteResult 算路结果,算路唯一标识在此对象中。
* Route calculation result, the unique identifier of the route calculation is in this object
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type calculateRouteResult:(AMapNaviCalculateRouteResult *)calculateRouteResult;
/**
* @brief 驾车路径规划失败后的回调函数. 从5.3.0版本起,算路失败后导航SDK只对外通知算路失败,SDK内部不再执行停止导航的相关逻辑.因此,当算路失败后,不会收到 driveManager:updateNaviMode: 回调; AMapNaviDriveManager.naviMode 不会切换到 AMapNaviModeNone 状态, 而是会保持在 AMapNaviModeGPS or AMapNaviModeEmulator 状态.
* Callback function after driving route planning fails. Starting from version 5.3.0, when route calculation fails, the navigation SDK only notifies the failure externally and no longer executes the related logic to stop navigation internally. Therefore, when route calculation fails, the driveManager:updateNaviMode: callback will not be received; AMapNaviDriveManager.naviMode will not switch to AMapNaviModeNone state, but will remain in AMapNaviModeGPS or AMapNaviModeEmulator state.
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param error 错误信息,error.code参照 AMapNaviCalcRouteState
* Error message, error.code reference AMapNaviCalcRouteState
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error;
/**
* @brief 驾车路径规划失败后的回调函数. since 6.1.0
* Callback function after driving route planning fails
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param error 错误信息,error.code参照 AMapNaviCalcRouteState
* Error message, error.code reference AMapNaviCalcRouteState
* @param type 路径规划类型,参考 AMapNaviRoutePlanType
* Route planning type, refer to AMapNaviRoutePlanType
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error routePlanType:(AMapNaviRoutePlanType)type;
/**
* @brief 驾车路径规划失败后的回调函数. since 10.1.111
* Callback function after driving route planning fails
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param error 错误信息,error.code参照 AMapNaviCalcRouteState
* Error message, error.code reference AMapNaviCalcRouteState
* @param type 路径规划类型,参考 AMapNaviRoutePlanType
* Route planning type, refer to AMapNaviRoutePlanType
* @param calculateRouteResult calculateRouteResult 算路结果,算路唯一标识在此对象中。
* Routing result, the unique identifier of the routing is in this object
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error routePlanType:(AMapNaviRoutePlanType)type calculateRouteResult:(AMapNaviCalculateRouteResult *)calculateRouteResult;
/**
* @brief 启动导航后回调函数
* Callback function after navigation starts
* @param naviMode 导航类型,参考 AMapNaviMode .
* Navigation type, refer to AMapNaviMode
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager didStartNavi:(AMapNaviMode)naviMode;
/**
* @brief 停止导航后回调函数. since 10.1.300
* @param driveManager 驾车导航管理类
* @param isStopped 是否停止导航成功
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager didStopNavi:(BOOL)isStopped;
/**
* @brief 出现偏航需要重新计算路径时的回调函数.偏航后 SDK 内部将自动重新路径规划,该方法将在自动重新路径规划前通知您进行额外的处理,您无需自行算路.
* Callback function when route recalculation is needed due to deviation. After deviation, the SDK will automatically replan the route internally. This method will notify you for additional processing before automatic rerouting, so you don't need to calculate the route yourself.
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManagerNeedRecalculateRouteForYaw:(AMapNaviDriveManager *)driveManager;
/**
* @brief 前方遇到拥堵需要重新计算路径时的回调函数.拥堵后 SDK 将自动重新路径规划,该方法将在自动重新路径规划前通知您进行额外的处理,您无需自行算路.
* The callback function when encountering congestion ahead and needing to recalculate the route. After congestion, the SDK will automatically recalculate the route. This method will notify you for additional processing before the automatic route recalculation, and you do not need to calculate the route yourself.
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManagerNeedRecalculateRouteForTrafficJam:(AMapNaviDriveManager *)driveManager;
/**
* @brief 导航到达某个途经点的回调函数
* Callback function when navigation reaches a waypoint
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param wayPointIndex 到达的途径点的索引值,表示的是 AMapNaviRoute.wayPointsInfo 的索引.
* The index value of the reached waypoint, which represents the index of AMapNaviRoute.wayPointsInfo.
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onArrivedWayPoint:(int)wayPointIndex;
/**
* @brief 开发者请根据实际情况返回是否正在播报语音如果正在播报语音请返回YES, 如果没有在播报语音请返回NO
* Developers, please return whether voice is currently being broadcast based on the actual situation. If voice is being broadcast, please return YES. If no voice is being broadcast, please return NO
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @return 如一直返回YESSDK内部会认为外界声道较忙导致部分文字无法吐出; 如一直返回NO文字吐出的频率可能会过快会出现打断的情况所以请根据实际情况返回。
* If YES is returned continuously, the SDK will consider the external audio channel to be busy, causing some text to be unable to be output; if NO is returned continuously, the frequency of text output may be too fast, leading to interruptions, so please return based on the actual situation.
*/
- (BOOL)driveManagerIsNaviSoundPlaying:(AMapNaviDriveManager *)driveManager;
/**
* @brief 导航播报信息回调函数,此回调函数需要和driveManagerIsNaviSoundPlaying:配合使用
* Navigation broadcast information callback function, this callback function needs to be used in conjunction with driveManagerIsNaviSoundPlaying:
* @param driveManager 驾车导航管理类
* Driving navigation management 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)driveManager:(AMapNaviDriveManager *)driveManager playNaviSoundString:(NSString *)soundString soundStringType:(AMapNaviSoundType)soundStringType;
/**
* @brief 模拟导航到达目的地后的回调函数
* Callback function after simulated navigation reaches the destination
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManagerDidEndEmulatorNavi:(AMapNaviDriveManager *)driveManager;
/**
* @brief 实时导航到达目的地后的回调函数
* Callback function after real-time navigation reaches the destination
* @param driveManager 驾车导航管理类
* Driving navigation management class
*/
- (void)driveManagerOnArrivedDestination:(AMapNaviDriveManager *)driveManager;
/**
* @brief 导航(巡航)过程中播放提示音的回调函数. since 5.4.0
* Callback function for playing prompts during navigation (cruising)
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param ringType 提示音类型,参考 AMapNaviRingType .
* Prompt tone type, refer to AMapNaviRingType
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onNaviPlayRing:(AMapNaviRingType)ringType;
/**
* @brief 卫星定位信号强弱回调函数. since 5.5.0
* Callback function for satellite positioning signal strength
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param gpsSignalStrength 卫星定位信号强度类型,参考 AMapNaviGPSSignalStrength .
* Satellite positioning signal strength type, refer to AMapNaviGPSSignalStrength
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager updateGPSSignalStrength:(AMapNaviGPSSignalStrength)gpsSignalStrength;
/**
* @brief 实时导航中关于路线的‘信息通知’回调. since 6.2.0
* 'Information notification' callback regarding the route in real-time navigation
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param notifyData 通知信息, 参考 AMapNaviRouteNotifyData .
* Notification information, refer to AMapNaviRouteNotifyData
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager postRouteNotification:(AMapNaviRouteNotifyData *)notifyData;
/**
* @brief 多路线实时导航模式下,建议将某备选路线切换为主导航路线的回调函数. since 6.3.0
* Callback function suggesting switching an alternative route to the main navigation route in multi-route real-time navigation mode
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param suggestChangeMainNaviRouteInfo 切换主导航路线的相关信息, 参考 AMapNaviSuggestChangeMainNaviRouteInfo .
* Information about switching the main navigation route, refer to AMapNaviSuggestChangeMainNaviRouteInfo
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onSuggestChangeMainNaviRoute:(AMapNaviSuggestChangeMainNaviRouteInfo *)suggestChangeMainNaviRouteInfo;
/**
* @brief 驾车导航道路舒适度回调。特别注意:当前接口为收费接口,您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/ since 9.3.5
* Driving navigation road comfort callback. Special note: This is a paid API. If you wish to apply for a trial or official use, please submit a business cooperation ticket via the ticket system for communication https://lbs.amap.com/
* @param manager 驾车导航管理类
* Driving navigation management class
* @param driveComfort 驾车舒适度信息对象
* Driving comfort information object
*/
- (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateDriveComfort:(AMapNaviDriveComfort *_Nonnull)driveComfort;
/**
* 驾车导航三急(急加速/急减速/急转弯)事件回调。特别注意:当前接口为收费接口,您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/ since 9.3.5
* Driving navigation three urgent (sudden acceleration/sudden deceleration/sudden turn) event callback. Special note: This is a paid API. If you wish to apply for a trial or official use, please submit a business cooperation ticket via the ticket system for communication https://lbs.amap.com/
* @brief 驾车导航三急(急加速/急减速/急转弯)事件回调。特别注意:当前接口为收费接口,您如果申请试用或者正式应用都请通过工单系统提交商务合作类工单进行沟通 https://lbs.amap.com/ since 9.3.5
* Driving navigation three emergency (rapid acceleration/rapid deceleration/rapid turning) event callback. Special note: The current interface is a paid interface. If you apply for a trial or formal application, please submit a business cooperation work order through the work order system for communication. https://lbs. amap. com/since 9.3.5
* @param manager 驾车导航管理类
* Driving navigation management class
* @param driveEvent 驾驶事件信息对象
* Driving event information object
*/
- (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateDriveEvent:(AMapNaviDriveEvent *_Nonnull)driveEvent;
/**
* 路段限速值进入新的路段后会回调当前路段的限速值进入没有限速的路段时限速值回调为0。since 9.6.0
* Road speed limit value. After entering a new road section, the speed limit value of the current section will be called back. When entering a road section without a speed limit, the speed limit value will be called back to 0
* @brief 路段限速值进入新的路段后会回调当前路段的限速值进入没有限速的路段时限速值回调为0。since 9.6.0
* The speed limit value of the road section. After entering a new road section, the speed limit value of the current road section will be called back. When entering a road section without a speed limit, the speed limit value will be called back to 0. since 9.6.0
* @param manager 驾车导航管理类
* Driving navigation management class
* @param speed 路段限速值
* Road speed limit value
*/
- (void)driveManager:(AMapNaviDriveManager *_Nullable)manager onUpdateNaviSpeedLimitSection:(NSInteger)speed;
/**
* @brief 开始播放PCM数据回调函数
* Callback function when starting to play PCM data
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param playTask PCM播放任务对象
* PCM play task object
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onStartPlayPCMData:(nonnull AMapNaviPCMTask *)playTask;
/**
* @brief 播放PCM数据回调函数
* Callback function when playing PCM data
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param info PCM数据信息对象
* PCM data info object
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onPlayPCMData:(nonnull AMapNaviPCMTask *)playTask;
/**
* @brief PCM数据播放完成回调函数
* Callback function when PCM data playback is finished
* @param driveManager 驾车导航管理类
* Driving navigation management class
* @param playTask PCM播放任务对象
* PCM play task object
*/
- (void)driveManager:(AMapNaviDriveManager *)driveManager onPCMDataFinished:(nonnull AMapNaviPCMTask *)playTask;
@end
NS_ASSUME_NONNULL_END