From a24f41a8d5e88aaf53fc0aa150f2d4922e321395 Mon Sep 17 00:00:00 2001 From: xiaogg Date: Mon, 9 Mar 2026 09:38:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec | 50 + .../AMapNavIOSSDK.bundle/icon_close@2x.png | Bin 0 -> 1351 bytes .../AMapNavIOSSDK.bundle/icon_dingwei@2x.png | Bin 0 -> 4261 bytes .../AMapNavIOSSDK.bundle/icon_fanhui@2x.png | Bin 0 -> 1956 bytes .../AMapNavIOSSDK.bundle/icon_local@2x.png | Bin 0 -> 840 bytes .../Assets/PrivacyInfo.xcprivacy | 31 + .../Classes/Class/ABaseViewController.h | 24 + .../Classes/Class/ABaseViewController.m | 33 + .../Classes/Class/AMapHyStationModel.h | 79 ++ .../Classes/Class/AMapHyStationModel.m | 21 + .../Classes/Class/AMapNavSDKHeader.h | 12 + .../Classes/Class/AMapNavSDKManager.h | 31 + .../Classes/Class/AMapNavSDKManager.m | 72 ++ .../Classes/Class/ARoutePlaneController.h | 22 + .../Classes/Class/ARoutePlaneController.m | 930 ++++++++++++++++++ .../Classes/Class/ASearchAddressController.h | 22 + .../Classes/Class/ASearchAddressController.m | 232 +++++ .../Classes/Tools/AMapNavCommonUtil.h | 19 + .../Classes/Tools/AMapNavCommonUtil.m | 27 + .../Classes/Tools/AMapNavHttpUtil.h | 19 + .../Classes/Tools/AMapNavHttpUtil.m | 114 +++ .../Classes/Tools/AMapPrivacyUtility.h | 32 + .../Classes/Tools/AMapPrivacyUtility.m | 137 +++ .../Classes/Tools/NaviPointAnnotation.h | 22 + .../Classes/Tools/NaviPointAnnotation.m | 13 + .../Classes/Tools/SelectableOverlay.h | 24 + .../Classes/Tools/SelectableOverlay.m | 41 + ln_jq_app/ios/Podfile | 2 +- ln_jq_app/ios/Podfile.lock | 6 +- 29 files changed, 2011 insertions(+), 4 deletions(-) create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_close@2x.png create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_dingwei@2x.png create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_fanhui@2x.png create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_local@2x.png create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/PrivacyInfo.xcprivacy create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKHeader.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.m create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.h create mode 100644 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.m create mode 100755 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.h create mode 100755 ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.m diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec new file mode 100644 index 0000000..60e22d0 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec @@ -0,0 +1,50 @@ +# +# Be sure to run `pod lib lint AMapNavIOSSDK.podspec' to ensure this is a +# valid spec before submitting. +# +# Any lines starting with a # are optional, but their use is encouraged +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = 'AMapNavIOSSDK' + s.version = '0.1.0' + s.summary = 'A short description of AMapNavIOSSDK.' + +# This description is used to generate tags and improve search results. +# * Think: What does it do? Why did you write it? What is the focus? +# * Try to keep it short, snappy and to the point. +# * Write the description between the DESC delimiters below. +# * Finally, don't worry about the indent, CocoaPods strips it! + + s.description = <<-DESC +TODO: Add long description of the pod here. + DESC + + s.homepage = 'https://github.com/xiaoshuai/AMapNavIOSSDK' + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'xiaoshuai' => 'xiaoshuai@net.cn' } + s.source = { :git => 'https://github.com/xiaoshuai/AMapNavIOSSDK.git', :tag => s.version.to_s } + # s.social_media_url = 'https://twitter.com/' + + s.ios.deployment_target = '12.0' + + s.source_files = 'AMapNavIOSSDK/Classes/**/*' + s.resource = 'AMapNavIOSSDK/**/*.bundle' + s.resource_bundles = { + 'AMapNavIOSSDKPrivacyInfo' => ['AMapNavIOSSDK/**/PrivacyInfo.xcprivacy'] + } + + # s.public_header_files = 'Pod/Classes/**/*.h' + # s.frameworks = 'UIKit', 'MapKit' + # s.dependency 'AFNetworking', '~> 2.3' + + s.dependency 'Masonry' + s.dependency 'MJExtension' + + s.dependency 'AMapNavi-NO-IDFA' + s.dependency 'AMapLocation-NO-IDFA' + s.dependency 'AMapSearch-NO-IDFA' + +end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_close@2x.png b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_close@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc8e7b889e3a281e700cc7a769d25c766392fe3 GIT binary patch literal 1351 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 GFa1BC$`d&N literal 0 HcmV?d00001 diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_local@2x.png b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Assets/AMapNavIOSSDK.bundle/icon_local@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..185c78a856b2b90b0fbe49ed819ad8ea41759d85 GIT binary patch literal 840 zcmV-O1GoH%P)Px&0!c(cR9HvNmrHC8Q547j=YAEWDpbRw-^>+{3ekjkbf!hHkqC)L!k$D>3oJ;y z7PJx;SSTW4uZc%OBsL`;ovBAi2vLu?cfKwvlxP}6zk6hS9&NvAed=qbcR6$JIlucq z=iYlRA?86b$H(9Ykg{?yvpGdXlYpFonVDY_iH%A%HuR-(p9++g&K*-wkZ1-_+|N|C zb#|u9T3YVD?`?jc0JiNOCBjx_T+`ZH3c%zDB5d2eN`xiMIHt9??VkZGt8$_c<|#8J zjKR!Q%6pt+@E>N$q+2co9ujfd7%?pf8ec`t?^OZYcFz%E4S=&sdF%fr_%B;2-7^5z zF{55gunD0t*YI{Q3mI6aZV4^6H|3+qS!mh_?eYJM*9KGt&{Ry(>}nQo7XujstkE z)X?d`jm}?o-2g1BVzUsU4&Y{`zD)-neCz2@N~ac}UD2xWL8biN+5ct@k#firfXa+9 z)j`m7A`76Tq^hW}(7X(#0(iAj{)L{7GAqYr0AHDTpAcV8hc?Cx+dxG70Sslv@+c*w zbXEa$K1^*#hnV#4-JSMu?r#Mw%Q+wfg$38BlvfokrPBb=B4*yHwSTy)jcq$Si0BZ& z*Ol@Y_mYY`04j~)njrA^b_0;oZ4Fn?%=5JNL&K~gr5hGx5z*(-Z{9rm*wtYC_!*;^ zhkpRju9P=2x^|o@BDx)_pp-W*uK>1PKALDmTfYHfPr=V34EO7}0WQMUjt((7s|dq< zSeCO%2s$ya+mJU0fqydc8~|cIh%zd~dK71biS;rH0b;+7Gb%Xeh$v4D3D;}w=iZQH z0Om{}N<7O)OU9g@s`b6sQK#eJZAwGh*xT|DBG!jVbkmXFuY><>nBVngd;1P=U*#|o SFk3YM0000 + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + 0A2A.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + 85F4.1 + + + + NSPrivacyCollectedDataTypes + + + diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.h new file mode 100644 index 0000000..062a4fe --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.h @@ -0,0 +1,24 @@ +// +// ABaseViewController.h +// ANavDemo +// +// Created by admin on 2026/2/5. +// + +#import +#import +#import "AMapNavCommonUtil.h" + +#define kRoutePlanBarHeight (self.navigationController.navigationBar.frame.size.height + UIApplication.sharedApplication.statusBarFrame.size.height + 0) + +#define kRoutePlanStatusBarHeight (UIApplication.sharedApplication.statusBarFrame.size.height + 0) + + + +NS_ASSUME_NONNULL_BEGIN + +@interface ABaseViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.m new file mode 100644 index 0000000..8aabf2b --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ABaseViewController.m @@ -0,0 +1,33 @@ +// +// ABaseViewController.m +// ANavDemo +// +// Created by admin on 2026/2/5. +// + +#import "ABaseViewController.h" + +@interface ABaseViewController () + +@end + +@implementation ABaseViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + + self.view.backgroundColor = [UIColor whiteColor]; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.h new file mode 100644 index 0000000..2c1b0cc --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.h @@ -0,0 +1,79 @@ +// +// AMapHyStationModel.h +// AMapNavIOSSDK +// +// Created by admin on 2026/2/11. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + { + "name": "嘉兴经开站", + "shortName": null, + "siteNo": null, + "city": null, + "address": "嘉兴市秀洲区岗山路272号", + "contact": "龚明伟", + "phone": "18888888888", + "type": null, + "coOpMode": null, + "booking": null, + "siteStatus": 0, + "startBusiness": "06:00:00", + "endBusiness": "22:00:00", + "billingMethod": null, + "term": null, + "remark": null, + "longitude": "120.75972800", + "latitude": "30.79962800" + } + */ +@interface AMapHyStationModel : NSObject + +@property (nonatomic, copy) NSString *name; +@property (nonatomic, copy, nullable) NSString *shortName; +@property (nonatomic, copy, nullable) NSString *siteNo; +@property (nonatomic, copy, nullable) NSString *city; +@property (nonatomic, copy, nullable) NSString *address; +@property (nonatomic, copy, nullable) NSString *contact; +@property (nonatomic, copy, nullable) NSString *phone; +@property (nonatomic, copy, nullable) NSString *type; +@property (nonatomic, copy, nullable) NSString *coOpMode; +@property (nonatomic, strong, nullable) NSString * booking; +@property (nonatomic, assign) NSInteger siteStatus; +@property (nonatomic, copy, nullable) NSString *startBusiness; +@property (nonatomic, copy, nullable) NSString *endBusiness; +@property (nonatomic, copy, nullable) NSString *billingMethod; +@property (nonatomic, copy, nullable) NSString *term; +@property (nonatomic, copy, nullable) NSString *remark; +@property (nonatomic, copy, nullable) NSString *longitude; +@property (nonatomic, copy, nullable) NSString *latitude; + +@end + +/** + { + "code": 0, + "status": true, + "message": "success", + "data": [], + "time": "1770800256408", + "error": null + } + */ + +@interface AMapHyResponse : NSObject +@property (nonatomic, assign) NSInteger code; +@property (nonatomic, assign) NSInteger status; +@property (nonatomic, copy, nullable) NSString *message; +@property (nonatomic, copy, nullable) NSString *time; +@property (nonatomic, copy, nullable) NSString *error; + +@property(nonatomic , strong)NSArray * data; + +@end +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.m new file mode 100644 index 0000000..b6c161f --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapHyStationModel.m @@ -0,0 +1,21 @@ +// +// AMapHyStationModel.m +// AMapNavIOSSDK +// +// Created by admin on 2026/2/11. +// + +#import "AMapHyStationModel.h" + +@implementation AMapHyStationModel + +@end + + +@implementation AMapHyResponse + ++ (NSDictionary *)mj_objectClassInArray { + return @{@"data" : AMapHyStationModel.class}; +} + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKHeader.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKHeader.h new file mode 100644 index 0000000..e2a6a10 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKHeader.h @@ -0,0 +1,12 @@ +// +// AMapNavSDKHeader.h +// Pods +// +// Created by admin on 2026/2/10. +// + +#ifndef AMapNavSDKHeader_h +#define AMapNavSDKHeader_h + + +#endif /* AMapNavSDKHeader_h */ diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.h new file mode 100644 index 0000000..638593a --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.h @@ -0,0 +1,31 @@ +// +// AMapNavSDKManager.h +// Pods +// +// Created by admin on 2026/2/10. +// + +#import + +#import "ARoutePlaneController.h" + +#define kAMapSDKDebugFlag + +NS_ASSUME_NONNULL_BEGIN + +@interface AMapNavSDKManager : NSObject + +@property (strong, nonatomic) UIWindow *window; + +@property (nonatomic , strong) NSString * localCity; +@property (nonatomic, copy) NSString * locationAddressDetail; + +@property (nonatomic , strong , readonly) UIViewController * targetVC; + ++ (instancetype)sharedManager; +- (void)configWithKey:(NSString*)key; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.m new file mode 100644 index 0000000..9f3378b --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/AMapNavSDKManager.m @@ -0,0 +1,72 @@ +// +// AMapNavSDKManager.m +// Pods +// +// Created by admin on 2026/2/10. +// + +#import "AMapNavSDKManager.h" +#import "AMapPrivacyUtility.h" + +#import + +@interface AMapNavSDKManager () +@property (nonatomic , strong , readwrite) UIViewController * targetVC; +@end + +@implementation AMapNavSDKManager + ++ (instancetype)sharedManager { + static AMapNavSDKManager *manager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + manager = [[AMapNavSDKManager alloc] init]; + }); + return manager; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _targetVC = [ARoutePlaneController new]; + } + + return self; +} + + + +- (void)configWithKey:(NSString*)key { + if (1) { + /* + * 调用隐私合规处理方法 + */ +// [AMapPrivacyUtility handlePrivacyAgreeStatusIn:_targetVC]; +// + // 初始化高德导航SDK + [self configureAPIKey:key]; + + } +} + +- (UIViewController *)targetVC { + return _targetVC; +} + +#pragma mark - private +- (void)configureAPIKey:(NSString*)key { + if ([key length] == 0) + { + NSString *reason = [NSString stringWithFormat:@"apiKey为空,请检查key是否正确设置。"]; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:reason delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; + + [alert show]; + } + [AMapServices sharedServices].enableHTTPS = YES; + [AMapServices sharedServices].apiKey = (NSString *)key; +} + + + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.h new file mode 100644 index 0000000..66d956a --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.h @@ -0,0 +1,22 @@ +// +// ARoutePlaneController.h +// ANavDemo +// +// Created by admin on 2026/2/5. +// + +#import +#import "ABaseViewController.h" + +#import "SelectableOverlay.h" +#import "NaviPointAnnotation.h" + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ARoutePlaneController : ABaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.m new file mode 100644 index 0000000..4a09f4a --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ARoutePlaneController.m @@ -0,0 +1,930 @@ +// +// ARoutePlaneController.m +// ANavDemo +// +// Created by admin on 2026/2/5. +// + +#import "ARoutePlaneController.h" + +#import +#import +#import +#import + +#import "ASearchAddressController.h" + +#import "AMapNavSDKManager.h" + +#import "AMapPrivacyUtility.h" + +#define kRouteIndicatorViewHeight 64.f + +#import "AMapHyStationModel.h" +#import "AMapNavHttpUtil.h" + +@interface ARoutePlaneController () +@property (nonatomic, strong) UITextField *textField; + +@property (nonatomic, strong) MAMapView *mapView; +@property (nonatomic,strong) AMapLocationManager *locationService; //定位服务 + +/** + * 经纬度 + */ +@property (nonatomic, assign) double latitude; +@property (nonatomic, assign) double longitude; + + +@property (nonatomic, strong) UITextField *startTf; +@property (nonatomic, strong) UITextField *dstTf; +@property (nonatomic, strong) UIButton *navBtn; + +@property (nonatomic, strong) AMapPOI *startPoi; +@property (nonatomic, strong) AMapPOI *dstPoi; + +@property (nonatomic, strong) AMapNaviCompositeManager *compositeManager;//nav +@property (nonatomic, assign) BOOL calRouteSuccess; + +@property (nonatomic, strong) NSDictionary * currentCalRoutePaths;//当前规划的路线 +@property (nonatomic , assign)BOOL isStartNav;//开始导航 +@property (nonatomic, strong) NSArray * lastOverLays; + + +@property (nonatomic , strong)NSArray * hyStationArr;//站点数据 +@property (nonatomic , assign)BOOL startQueryCurrnetNodeFlag;//开始查询当前节点; + +@end + +@implementation ARoutePlaneController + +- (void)viewDidLoad { + [super viewDidLoad]; + _startQueryCurrnetNodeFlag = NO; + + [self observePrivacyStatus]; + [self checkPrivacyStatus]; + + //// +// [self.naviManager independentCalculateDriveRouteWithStartPOIInfo:startPOIInfo +// endPOIInfo:endPOIInfo +// wayPOIInfos:wayPOIInfos +// strategy:AMapNaviDrivingStrategyMultipleDefault +// callback:^(AMapNaviRouteGroup *routeGroup, NSError *error) { +// if (error == nil) { +// // 算路成功,routeGroup 包含路线数据 +// [self startNaviWithRoute:routeGroup]; +// } +// }]; + +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + + + [AMapPrivacyUtility handlePrivacyAgreeStatusIn:self]; + +} + +#pragma mark - request +-(void)requestHyListWithParms:(NSDictionary*)dic { + NSString * url = @"https://beta-esg.api.lnh2e.com/appointment/station/getNearbyHydrogenStationsByLocation"; + + /** + //汽车公园有数据 + "longitude": "121.30461400", + "latitude": "31.17321100" + */ +// NSDictionary * dic = @{@"longitude":@"121.16661700" , @"latitude":@"31.27981600"}; + + + [AMapNavHttpUtil postRequestWithURL:url parameters:dic requestHeader:@{@"Content-Type":@"application/json; charset=UTF-8"} successHandler:^(NSDictionary * _Nonnull data, NSURLResponse * _Nonnull response) { + AMapHyResponse * resp = [AMapHyResponse mj_objectWithKeyValues:data]; + if (resp.code == 0 && resp.data) { + NSArray * allData = resp.data; + NSArray * dst = allData; + NSInteger len = allData.count; + if (allData.count > len) { + dst = [resp.data subarrayWithRange:NSMakeRange(0, len)]; + } + + [self updateMapAnnotationWithData:dst]; + }else { + NSLog(@">>>>>>>请求站点:%@" ,resp.message); + } + + } failureHandler:^(NSError * _Nonnull error) { + NSLog(@">>>>>>>请求站点err:%@" ,error.debugDescription); + }]; +} + +-(void)requestHyDetailWithParms:(NSDictionary*)dic { + NSString * url = @"https://beta-esg.api.lnh2e.com/appointment/station/getStationInfoByArea"; + + [AMapNavHttpUtil postRequestWithURL:url parameters:dic requestHeader:@{@"Content-Type":@"application/json; charset=UTF-8"} successHandler:^(NSDictionary * _Nonnull data, NSURLResponse * _Nonnull response) { + AMapHyResponse * resp = [AMapHyResponse mj_objectWithKeyValues:data]; + if (resp.code == 0) { + NSDictionary * resData = data[@"data"]; + AMapHyStationModel * station = [AMapHyStationModel mj_objectWithKeyValues:resData]; + [self updateHeadAddressWithStation:station]; + }else { + NSLog(@">>>>>>>请求站点detail:%@" ,resp.message); + } + + } failureHandler:^(NSError * _Nonnull error) { + NSLog(@">>>>>>>请求站点err:%@" ,error.debugDescription); + }]; +} + + +-(void)updateHeadAddressWithStation:(AMapHyStationModel*)model { + + AMapPOI * aoi = [[AMapPOI alloc] init]; + + aoi.location = [AMapGeoPoint locationWithLatitude:[model.latitude doubleValue] longitude:[model.longitude doubleValue]]; + + aoi.name = model.name; + + self.dstPoi = aoi; + + ///地址栏 + [self updateUIWithData:aoi textField:self.dstTf]; + + + ///地图显示 + [self updateMapAnnotationWithData:@[model]]; +} + +-(void)updateMapAnnotationWithData:(NSArray *)dataArr { + self.hyStationArr = dataArr; + if (!(dataArr && dataArr.count > 0)) { + return; + } + + ///添加标注 + NSMutableArray * points = [NSMutableArray arrayWithCapacity:dataArr.count]; + for (AMapHyStationModel * model in dataArr) { + MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init]; + if (!(model.latitude && model.longitude)) { + continue; + } + + pointAnnotation.coordinate = CLLocationCoordinate2DMake([model.latitude doubleValue], [model.longitude doubleValue]); + pointAnnotation.title = model.name; + [points addObject:pointAnnotation]; + } + + // 1. 先获取当前地图区域 +// MACoordinateRegion currentRegion = self.mapView.region; + + // 2. 添加标注但不改变地图显示 + [self.mapView addAnnotations:points]; + + // 保持地图中心点为当前位置 + if (self.latitude && self.longitude) { + [self.mapView setCenterCoordinate: CLLocationCoordinate2DMake(self.latitude, self.longitude) animated:YES]; + } + + // 3. 保持当前区域不变 +// [self.mapView setRegion:currentRegion animated:NO]; + + +} + +#pragma mark - +-(void)initSubview { + UITextField * startTf = [[UITextField alloc] init]; + startTf.borderStyle = UITextBorderStyleRoundedRect; + startTf.placeholder = @"起点"; + startTf.tag = 100; + startTf.delegate = self; + startTf.font = [UIFont systemFontOfSize:13]; + [self.view addSubview:startTf]; + + [startTf mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.view).offset(kRoutePlanStatusBarHeight + 35); + make.left.mas_equalTo(self.view).offset(5); + make.width.mas_equalTo(@120); + make.height.mas_equalTo(@32); + }]; + + self.startTf = startTf; + + UITextField * dstTf = [[UITextField alloc] init]; + dstTf.borderStyle = UITextBorderStyleRoundedRect; + dstTf.placeholder = @"终点"; + dstTf.tag = 200; + dstTf.delegate = self; + dstTf.font = [UIFont systemFontOfSize:13]; + + [self.view addSubview:dstTf]; + + [dstTf mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(startTf); + make.left.mas_equalTo(startTf.mas_right).offset(15); +// make.right.mas_equalTo(self.view).offset(-5); + make.width.height.mas_equalTo(startTf); + }]; + self.dstTf = dstTf; + + UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; + [btn setTitle:@"规划线路" forState:UIControlStateNormal]; + btn.backgroundColor = [UIColor whiteColor]; + btn.titleLabel.font = [UIFont systemFontOfSize:14]; + + btn.layer.borderColor = [UIColor blueColor].CGColor; + btn.layer.borderWidth = 1; + btn.layer.cornerRadius = 5; + + [btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + [btn addTarget:self action:@selector(calRoutePath) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:btn]; + [btn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(dstTf.mas_right).offset(12); + make.top.mas_equalTo(startTf); + make.right.mas_equalTo(self.view).offset(-5); + make.height.mas_equalTo(@30); + }]; + + + UIButton * navBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + [navBtn setTitle:@"导航>" forState:UIControlStateNormal]; + navBtn.backgroundColor = [UIColor whiteColor]; + navBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + + navBtn.layer.borderColor = [UIColor blueColor].CGColor; + navBtn.layer.borderWidth = 1; + navBtn.layer.cornerRadius = 6; + + [navBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + [navBtn addTarget:self action:@selector(navAction) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:navBtn]; + [navBtn mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(self.view).offset(12); +// make.centerX.equalTo(self.view); + make.right.equalTo(self.view).offset(-15); + make.bottom.equalTo(self.view).offset(-118); + make.height.mas_equalTo(@30); + make.width.mas_equalTo(@60); + }]; + + + [self.mapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self.view); +// make.top.equalTo(startTf.mas_bottom).offset(5); + make.top.equalTo(self.view).offset(0); +// make.bottom.equalTo(navBtn.mas_top).offset(-3); + make.bottom.equalTo(self.view).offset(0); + }]; + + [self.view bringSubviewToFront:navBtn]; +} + +- (void)initDriveManager +{ + //请在 dealloc 函数中执行 [AMapNaviDriveManager destroyInstance] 来销毁单例 + [[AMapNaviDriveManager sharedInstance] setDelegate:self]; +} + + +- (void)initMapView +{ + if (self.mapView == nil) + { + self.mapView = [[MAMapView alloc] initWithFrame:CGRectZero]; + [self.mapView setDelegate:self]; + self.mapView.showsUserLocation = YES; + self.mapView.userTrackingMode = MAUserTrackingModeFollowWithHeading; + self.mapView.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; // 定位精度 + _mapView.showsScale= YES; + + CGFloat ze = self.mapView.zoomLevel; + self.mapView.zoomLevel = 9; + + // 2. 禁用所有不必要的动画和自动调整 +// self.mapView.autoresizesSubviews = NO; +// [self.mapView setShowsWorldMap:NO]; // 不显示世界地图 + + // 3. 固定缩放级别 +// [self.mapView setMinZoomLevel:6.0]; +// [self.mapView setMaxZoomLevel:20.0]; +// [self.mapView setZoomLevel:10.0 animated:NO]; + + + // 4. 禁用自动调整 +// [self.mapView setAutoCheckMapBoundary:NO]; + + [self.view addSubview:self.mapView]; + + if (@available(iOS 14.0, *)) { + // iOS14+ 需要额外处理 + CLAuthorizationStatus status = [[[CLLocationManager alloc] init] authorizationStatus]; + if (status == kCLAuthorizationStatusNotDetermined) { + [[[CLLocationManager alloc] init] requestWhenInUseAuthorization]; + } + } + + ///TEST +// MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init]; +// pointAnnotation.coordinate = CLLocationCoordinate2DMake(31.19, 121.32); +// pointAnnotation.title = @"嘉兴经开站"; +// [_mapView addAnnotation:pointAnnotation]; +// +// MAPointAnnotation *pointAnnotation2 = [[MAPointAnnotation alloc] init]; +// pointAnnotation2.coordinate = CLLocationCoordinate2DMake(30.81669400, 120.94291800); +// pointAnnotation2.title = @"测试站点1"; +// [_mapView addAnnotation:pointAnnotation2]; + + + + UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; + [btn setImage:[AMapNavCommonUtil imageWithName:@"icon_local"] forState:UIControlStateNormal]; + btn.backgroundColor = [UIColor lightGrayColor]; + btn.titleLabel.font = [UIFont systemFontOfSize:14]; + btn.layer.cornerRadius = 20; + + [btn addTarget:self action:@selector(updateUserLocalAction) forControlEvents:UIControlEventTouchUpInside]; + + [self.view addSubview:btn]; + [btn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.view).offset(-10); + make.width.height.equalTo(@40); + make.top.equalTo(self.view).offset(150); + }]; + + } +} + +-(void)updateUserLocalAction { + // 如果已经有位置,直接移动视角 + if (_mapView.userLocation.location) { + CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(self.latitude, self.longitude); + + [_mapView setCenterCoordinate:coord animated:YES]; +// [_mapView setZoomLevel:10 animated:YES]; + } else { + // 如果尚未获取到位置,进入跟踪模式等待回调 + [_mapView setUserTrackingMode:MAUserTrackingModeFollow animated:YES]; + } + +} + +- (void)initAnnotations +{ + NaviPointAnnotation *beginAnnotation = [[NaviPointAnnotation alloc] init]; + [beginAnnotation setCoordinate:CLLocationCoordinate2DMake(self.startPoi.location.latitude, self.startPoi.location.longitude)]; + beginAnnotation.title = @"起始点"; + beginAnnotation.navPointType = NaviPointAnnotationStart; + + [self.mapView addAnnotation:beginAnnotation]; + +// NaviPointAnnotation *endAnnotation = [[NaviPointAnnotation alloc] init]; +// [endAnnotation setCoordinate:CLLocationCoordinate2DMake(self.dstPoi.location.latitude, self.dstPoi.location.longitude)]; +// endAnnotation.title = @"终点"; +// endAnnotation.navPointType = NaviPointAnnotationEnd; +// +// [self.mapView addAnnotation:endAnnotation]; +} + + + + +- (AMapLocationManager *)locationService { + if (!_locationService) { + _locationService = [[AMapLocationManager alloc] init]; + _locationService.delegate = self; + _locationService.desiredAccuracy = kCLLocationAccuracyBest; // 最高精度模式 + _locationService.distanceFilter = 5; + _locationService.locatingWithReGeocode = YES; + } + return _locationService; +} + + + +- (void)dealloc { + [self.locationService stopUpdatingLocation]; + +} + +- (AMapNaviCompositeManager *)compositeManager { + + if (!_compositeManager) { + _compositeManager = [[AMapNaviCompositeManager alloc] init]; // 初始化 + _compositeManager.delegate = self; // 如果需要使用AMapNaviCompositeManagerDelegate的相关回调(如自定义语音、获取实时位置等),需要设置delegate + } + return _compositeManager; +} + +// 监听隐私状态变化 +- (void)observePrivacyStatus { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handlePrivacyUpdate) + name:@"ksAMapPrivacyDidUpdateNotification" // 自定义通知 + object:nil]; +} + +-(void)handlePrivacyUpdate { + [self checkPrivacyStatus]; + +} + +// 检查当前隐私状态 +- (void)checkPrivacyStatus { + BOOL hasAgreed = [[NSUserDefaults standardUserDefaults] boolForKey:@"usragreeStatus"]; + + if (hasAgreed) { + + /// 开启定位 + [self.locationService startUpdatingLocation]; +// [self.mapView reloadMap]; + + [self initMapView]; + [self initSubview]; + + [self initDriveManager]; + + } else { + + } +} + +#pragma mark - Action +///选择方式 +-(void)navAction { + [self showSelectNavType]; +} + +-(void)showSelectNavType { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"选择导航类型" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; + UIAlertAction *sure = [UIAlertAction actionWithTitle:@"SDK导航" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [self navigationType_sdk]; + }]; + UIAlertAction *sure2 = [UIAlertAction actionWithTitle:@"高德地图导航" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + + [self navigationType_app]; + }]; + + UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + }]; + + [alert addAction:sure]; + [alert addAction:sure2]; + [alert addAction:cancel]; + + [self presentViewController:alert animated:YES completion:nil]; +} + +-(void)navigationType_app { + + NSURL* scheme = [NSURL URLWithString:@"iosamap://"]; + BOOL canOpen = [[UIApplication sharedApplication] canOpenURL:scheme]; + if (!canOpen) { + [self showAlertWithMessage:@"请先安装高德地图客户端"]; return; + } + + NSString *myLocationScheme = [NSString stringWithFormat:@"iosamap://navi?sourceApplication=ANavDemo&lat=31.2304&lon=121.4737&t=0&dev=1"]; + + NSString *encodedUrlString = [myLocationScheme stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; + + NSURL *gaodeUrl = [NSURL URLWithString:encodedUrlString]; + + + [[UIApplication sharedApplication] openURL:gaodeUrl options:@{} completionHandler:^(BOOL res) { + + }]; + +} + +-(void)navigationType_sdk { + id delegate = [AMapNaviDriveManager sharedInstance].delegate; + if (!delegate) { + [AMapNaviDriveManager sharedInstance].delegate = self; + } + + + NSDictionary * routes = [AMapNaviDriveManager sharedInstance].naviRoutes; + if (!routes) { + NSLog(@"暂无路线信息!!!!!!!!!"); + self.isStartNav = YES; + [self calRoutePath]; + + return; + } + + + AMapNaviCompositeUserConfig *config = [[AMapNaviCompositeUserConfig alloc] init]; + +// [config setRoutePlanPOIType:AMapNaviRoutePlanPOITypeEnd location:[AMapNaviPoint locationWithLatitude:32.21 longitude:121.34] name:@"故宫22" POIId:nil]; + + [config setStartNaviDirectly:YES]; //直接进入导航界面 + [config setNeedCalculateRouteWhenPresent:NO];//不在算路 + [config setMultipleRouteNaviMode:NO];//直接单线路径导航 +// [config setNeedDestoryDriveManagerInstanceWhenDismiss:NO]; + + self.isStartNav = NO; + + [self.compositeManager presentRoutePlanViewControllerWithOptions:config]; + +} + + +#pragma mark - 计算线路 +///计算线路 +-(void)calRoutePath { +// [self.mapView removeOverlays:self.mapView.overlays]; +// self.startTf.text = @"click calpath"; +// return; + + [self initAnnotations]; + + AMapNaviPoint * startPoint = [AMapNaviPoint locationWithLatitude:self.startPoi.location.latitude longitude:self.startPoi.location.longitude]; + + AMapNaviPoint * endPoint = [AMapNaviPoint locationWithLatitude:self.dstPoi.location.latitude longitude:self.dstPoi.location.longitude]; + + AMapNaviDrivingStrategy strategy = ConvertDrivingPreferenceToDrivingStrategy(0, + 0, + 0, + 0, + 0); + + id delegate = [AMapNaviDriveManager sharedInstance].delegate; + if (!delegate) { + [AMapNaviDriveManager sharedInstance].delegate = self; + } + + [[AMapNaviDriveManager sharedInstance] calculateDriveRouteWithStartPoints:@[startPoint] + endPoints:@[endPoint] + wayPoints:nil + drivingStrategy:strategy]; + +} + + +- (void)driveManagerOnCalculateRouteSuccess:(AMapNaviDriveManager *)driveManager +{ + NSLog(@"onCalculateRouteSuccess"); + //算路成功后显示路径 + [self showNaviRoutes]; +} + +- (void)showNaviRoutes +{ + if ([[AMapNaviDriveManager sharedInstance].naviRoutes count] <= 0) + { + return; + } + + self.lastOverLays = self.mapView.overlays; + [self.mapView removeOverlays:self.mapView.overlays]; +// [self.routeIndicatorInfoArray removeAllObjects]; + + self.currentCalRoutePaths = [AMapNaviDriveManager sharedInstance].naviRoutes; + + + NSInteger routeId = 0; + + //将路径显示到地图上 + for (NSNumber *aRouteID in [[AMapNaviDriveManager sharedInstance].naviRoutes allKeys]) + { + AMapNaviRoute *aRoute = [[[AMapNaviDriveManager sharedInstance] naviRoutes] objectForKey:aRouteID]; + int count = (int)[[aRoute routeCoordinates] count]; + + //添加路径Polyline + CLLocationCoordinate2D *coords = (CLLocationCoordinate2D *)malloc(count * sizeof(CLLocationCoordinate2D)); + for (int i = 0; i < count; i++) + { + AMapNaviPoint *coordinate = [[aRoute routeCoordinates] objectAtIndex:i]; + coords[i].latitude = [coordinate latitude]; + coords[i].longitude = [coordinate longitude]; + } + + MAPolyline *polyline = [MAPolyline polylineWithCoordinates:coords count:count]; + + SelectableOverlay *selectablePolyline = [[SelectableOverlay alloc] initWithOverlay:polyline]; + [selectablePolyline setRouteID:[aRouteID integerValue]]; + + [self.mapView addOverlay:selectablePolyline]; + free(coords); + + routeId = [aRouteID integerValue]; + + } + + // 1. 先获取当前地图区域 + MACoordinateRegion currentRegion = self.mapView.region; + + [self.mapView showAnnotations:self.mapView.annotations animated:NO]; + + // 3. 保持当前区域不变 + [self.mapView setRegion:currentRegion animated:NO]; + + [self selectNaviRouteWithID:routeId]; + + ///如果已开始导航,直接进入导航 + if (self.isStartNav) { + [self navigationType_sdk]; + } + +} + +- (void)selectNaviRouteWithID:(NSInteger)routeID +{ + //在开始导航前进行路径选择 + if ([[AMapNaviDriveManager sharedInstance] selectNaviRouteWithRouteID:routeID]) + { + [self selecteOverlayWithRouteID:routeID]; + } + else + { + NSLog(@"路径选择失败!"); + } +} + +- (void)selecteOverlayWithRouteID:(NSInteger)routeID +{ + [self.mapView.overlays enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id overlay, NSUInteger idx, BOOL *stop) + { + if ([overlay isKindOfClass:[SelectableOverlay class]]) + { + SelectableOverlay *selectableOverlay = overlay; + + /* 获取overlay对应的renderer. */ + MAPolylineRenderer * overlayRenderer = (MAPolylineRenderer *)[self.mapView rendererForOverlay:selectableOverlay]; + + if (selectableOverlay.routeID == routeID) + { + /* 设置选中状态. */ + selectableOverlay.selected = YES; + + /* 修改renderer选中颜色. */ + overlayRenderer.fillColor = selectableOverlay.selectedColor; + overlayRenderer.strokeColor = selectableOverlay.selectedColor; + + /* 修改overlay覆盖的顺序. */ + [self.mapView exchangeOverlayAtIndex:idx withOverlayAtIndex:self.mapView.overlays.count - 1]; + } + else + { + /* 设置选中状态. */ + selectableOverlay.selected = NO; + + /* 修改renderer选中颜色. */ + overlayRenderer.fillColor = selectableOverlay.regularColor; + overlayRenderer.strokeColor = selectableOverlay.regularColor; + } + } + }]; +} + +#pragma mark - AMapLocationManagerDelegate +- (void)amapLocationManager:(AMapLocationManager *)manager didUpdateLocation:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode +{ + if (!location) { + return; + } + self.latitude = location.coordinate.latitude; + self.longitude = location.coordinate.longitude; + + AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager]; + sdk.localCity = reGeocode.city; + sdk.locationAddressDetail = reGeocode.POIName; + + // 设置地图中心为用户位置 +// MACoordinateRegion region = MACoordinateRegionMake(location.coordinate, +// MACoordinateSpanMake(0.1, 0.1)); +// [self.mapView setRegion:region animated:YES]; + + + //更新出发点 + AMapPOI * aoi = [[AMapPOI alloc] init]; +#ifdef kAMapSDKDebugFlag + aoi.location = [AMapGeoPoint locationWithLatitude:31.23 longitude:121.48 ]; + aoi.name =@"人民大道185号"; +#else + aoi.location = [AMapGeoPoint locationWithLatitude:self.latitude longitude:self.longitude ]; + aoi.name = reGeocode.POIName; +#endif + + self.startPoi = aoi; + [self updateUIWithData:aoi textField:self.startTf]; + + //获取附近站点 + if (!self.startQueryCurrnetNodeFlag && reGeocode) { + self.startQueryCurrnetNodeFlag = YES; + NSString * province = reGeocode.province; + NSString * city = reGeocode.city; + NSString * district = reGeocode.district; + NSString * longitude = [NSString stringWithFormat:@"%f",self.longitude]; + NSString * latitude = [NSString stringWithFormat:@"%f",self.latitude]; + + if (province && city && district) { + NSDictionary * dic = @{@"province":province , @"city":city , @"district":district , @"longitude":longitude , @"latitude":latitude}; + + [self requestHyDetailWithParms:dic]; + } + + [self requestHyListWithParms:@{@"longitude":longitude , @"latitude":latitude}]; + } + + +} + +#pragma mark - MAMapView 渲染 + +- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id)annotation +{ + if ([annotation isKindOfClass:[NaviPointAnnotation class]]) + { + static NSString *annotationIdentifier = @"NaviPointAnnotationIdentifier"; + + MAPinAnnotationView *pointAnnotationView = (MAPinAnnotationView*)[self.mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; + if (pointAnnotationView == nil) + { + pointAnnotationView = [[MAPinAnnotationView alloc] initWithAnnotation:annotation + reuseIdentifier:annotationIdentifier]; + } + + pointAnnotationView.animatesDrop = NO; + pointAnnotationView.canShowCallout = YES; + pointAnnotationView.draggable = NO; + + NaviPointAnnotation *navAnnotation = (NaviPointAnnotation *)annotation; + + if (navAnnotation.navPointType == NaviPointAnnotationStart) + { + [pointAnnotationView setPinColor:MAPinAnnotationColorGreen]; + } + else if (navAnnotation.navPointType == NaviPointAnnotationEnd) + { + [pointAnnotationView setPinColor:MAPinAnnotationColorRed]; + } + + return pointAnnotationView; + } + + if ( [annotation isMemberOfClass:[MAPointAnnotation class]]) + { + MAUserLocation *user = (MAUserLocation *)annotation; + + static NSString *pointReuseIndentifier = @"pointReuseIndentifier"; + MAPinAnnotationView*annotationView = (MAPinAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:pointReuseIndentifier]; + if (annotationView == nil) + { + annotationView = [[MAPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:pointReuseIndentifier]; + } + annotationView.canShowCallout= YES; //设置气泡可以弹出,默认为NO + annotationView.animatesDrop = NO; //设置标注动画显示,默认为NO + annotationView.draggable = NO; //设置标注可以拖动,默认为NO + annotationView.pinColor = MAPinAnnotationColorPurple; + + // 设置自定义的气泡背景色 + if (@available(iOS 14.0, *)) { + // iOS 14+ 可以使用 tintColor + annotationView.tintColor = [UIColor systemBlueColor]; + } else { + // iOS 13 及以下 + annotationView.tintColor = [UIColor colorWithRed:0.1 green:0.6 blue:0.9 alpha:1.0]; + } + + return annotationView; + } + + return nil; +} + +- (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id)overlay +{ + if ([overlay isKindOfClass:[SelectableOverlay class]]) + { + SelectableOverlay * selectableOverlay = (SelectableOverlay *)overlay; + id actualOverlay = selectableOverlay.overlay; + + MAPolylineRenderer *polylineRenderer = [[MAPolylineRenderer alloc] initWithPolyline:actualOverlay]; + + polylineRenderer.lineWidth = 8.f; + polylineRenderer.strokeColor = selectableOverlay.isSelected ? selectableOverlay.selectedColor : selectableOverlay.regularColor; + + return polylineRenderer; + } + + return nil; +} + +// 当地图添加完标注视图后调用 +- (void)mapView:(MAMapView *)mapView didAddAnnotationViews:(NSArray *)views { + // 遍历所有被添加的标注视图 +# if 0 + for (MAAnnotationView *view in views) { + // 检查是否为需要的标注类型,例如大头针标注 + if ([view.annotation isMemberOfClass:[MAPointAnnotation class]]) { + // 延迟零点几秒执行,以确保视图添加动画完成(可选,但可使效果更平滑) + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + // 选中该标注,从而使其气泡弹出 + [mapView selectAnnotation:view.annotation animated:YES]; + }); + } + } +#endif +} + +- (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view { + NSLog(@"didSelectAnnotationView: %s" , __func__); + +} + + +// 当标注被取消选中时调用 +- (void)mapView:(MAMapView *)mapView didDeselectAnnotationView:(MAAnnotationView *)view { + if ([view.annotation isMemberOfClass:[MAPointAnnotation class]]) { + // 可以立即或稍作延迟后重新选中 +// [mapView selectAnnotation:view.annotation animated:NO]; + } +} + +//选中一个点 +- (void)mapView:(MAMapView *)mapView didAnnotationViewCalloutTapped:(MAAnnotationView *)view { + id pointAnnotation = view.annotation; + if ([pointAnnotation isMemberOfClass:MAPointAnnotation.class]) { + MAPointAnnotation *point = (MAPointAnnotation *)view.annotation; + + + NSLog(@"point: %@" , point.title); + + AMapPOI * aoi = [[AMapPOI alloc] init]; + + aoi.location = [AMapGeoPoint locationWithLatitude:point.coordinate.latitude longitude:point.coordinate.longitude]; + + aoi.name = point.title; + + self.dstPoi = aoi; + + [self updateUIWithData:aoi textField:self.dstTf]; + + } + + NSLog(@"didSelectAnnotationView: %s" , __func__); + + +} + +#pragma mark - AMapNaviCompositeManagerDelegate +- (void)compositeManager:(AMapNaviCompositeManager *)compositeManager didStartNavi:(AMapNaviMode)naviMode { + + +} + +- (void)compositeManager:(AMapNaviCompositeManager *)compositeManager onDriveStrategyChanged:(AMapNaviDrivingStrategy)driveStrategy { + NSLog(@"%s" , __func__ ); + +} + +#pragma mark - UITextFieldDelegate +- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { + + ASearchAddressController * vc = [[ASearchAddressController alloc] init]; + + UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:vc]; + //UIModalPresentationOverFullScreen/UIModalPresentationFullScreen触发离开 + nav.modalPresentationStyle = UIModalPresentationOverFullScreen; + nav.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + + __weak typeof(self)weakSelf = self; + vc.selectAddressBlk = ^(AMapPOI * _Nonnull poi) { + [weakSelf updateUIWithData:poi textField:textField]; + }; + + [self presentViewController:nav animated:YES completion:^{ + + }]; + + return NO; +} + +-(void)updateUIWithData: (AMapPOI*)poi textField: (UITextField*)tf { + BOOL isStart = tf.tag == 100; + tf.text = poi.name; + + if (isStart) { + self.startPoi = poi; + }else { + self.dstPoi = poi; + } + +} + +#pragma mark - tool + +-(void)showAlertWithMessage:(NSString *)msg { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:msg preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *sure = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + }]; + + [alert addAction:sure]; + + [self.navigationController presentViewController:alert animated:YES completion:nil]; + +} + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.h new file mode 100644 index 0000000..0f682c9 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.h @@ -0,0 +1,22 @@ +// +// ASearchAddressController.h +// ANavDemo +// +// Created by admin on 2026/2/6. +// + +#import "ABaseViewController.h" + +#import +#import + + +NS_ASSUME_NONNULL_BEGIN + +@interface ASearchAddressController : ABaseViewController + +@property (nonatomic , copy) void(^selectAddressBlk)(AMapPOI * poi); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.m new file mode 100644 index 0000000..eb87923 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.m @@ -0,0 +1,232 @@ +// +// ASearchAddressController.m +// ANavDemo +// +// Created by admin on 2026/2/6. +// + +#import "ASearchAddressController.h" +#import "AMapNavSDKManager.h" + +#import + +#import "AMapNavCommonUtil.h" + +@interface ASearchAddressController () + +@property (nonatomic , strong) UITableView *tableView; +@property (nonatomic , strong) UIBarButtonItem *rightItem; +@property (nonatomic ,strong)UIButton * backBtn; + +@property (nonatomic , strong) NSArray *dataArr; + +@property (nonatomic, strong) UITextField *inputAddressTf; +@property (nonatomic, strong) AMapSearchAPI *search; +@end + +@implementation ASearchAddressController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.title = @"选择地点"; + + [self initSubview]; + + self.search = [[AMapSearchAPI alloc] init]; + self.search.delegate = self; + +#ifdef kAMapSDKDebugFlag + self.inputAddressTf.text = @"人民广场"; +#endif + +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + + [self.inputAddressTf becomeFirstResponder]; +} + +-(void)initSubview { + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:self.backBtn]; + + UITextField * inputAddressTf = [[UITextField alloc] init]; + inputAddressTf.borderStyle = UITextBorderStyleRoundedRect; + inputAddressTf.placeholder = @"输入地址"; + inputAddressTf.returnKeyType = UIReturnKeySearch; + inputAddressTf.tag = 100; + inputAddressTf.delegate = self; + + [self.view addSubview:inputAddressTf]; + + [inputAddressTf mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.view).offset(10); + make.top.mas_equalTo(self.view).offset(kRoutePlanBarHeight + 10); + make.height.mas_equalTo(@30); + }]; + + self.inputAddressTf = inputAddressTf; + + + + UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; + [btn setTitle:@"当前位置" forState:UIControlStateNormal]; + btn.backgroundColor = [UIColor whiteColor]; + btn.layer.borderColor = [UIColor blueColor].CGColor; + btn.layer.borderWidth = 1; + btn.layer.cornerRadius = 5; + btn.titleLabel.font = [UIFont systemFontOfSize:12]; + + [btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; + [btn addTarget:self action:@selector(searchBtnAction) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:btn]; + [btn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(inputAddressTf.mas_right).offset(12); + make.top.mas_equalTo(inputAddressTf); + make.right.mas_equalTo(self.view).offset(-10); + make.height.mas_equalTo(@30); + make.width.mas_equalTo(70); + }]; + + + [self.view addSubview:self.tableView]; + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(inputAddressTf.mas_bottom).offset(5); + make.left.equalTo(self.view); + make.bottom.equalTo(self.view); + make.centerX.equalTo(self.view); + + }]; + + [self.tableView reloadData]; +} + +#pragma mark - +- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + + AMapPOI * m = self.dataArr[indexPath.row]; + cell.textLabel.text = [NSString stringWithFormat:@"%@" , m.name ]; + + return cell; +} + +- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.dataArr.count; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + AMapPOI * m = self.dataArr[indexPath.row]; + + if (self.selectAddressBlk) { + self.selectAddressBlk(m); + } + + [self backBtnAction]; +// [self.navigationController popViewControllerAnimated:YES]; +} + +#pragma mark - +- (UITableView *)tableView { + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; + _tableView.delegate = self; + _tableView.dataSource = self; + } + + return _tableView; +} + +-(UIButton *)backBtn{ + if (!_backBtn) { + _backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; + _backBtn.frame = CGRectMake(0, 0, 40, 30); + _backBtn.imageEdgeInsets = UIEdgeInsetsMake(2, -5, 2, 5); + +// _backBtn.backgroundColor = UIColor.redColor; + [_backBtn setImage:[AMapNavCommonUtil imageWithName:@"icon_fanhui"] forState:UIControlStateNormal]; + [_backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _backBtn; +} + +-(void)backBtnAction { + [self dismissViewControllerAnimated:YES completion:^{ + + }]; + +} + +#pragma mark - Action +-(void)searchBtnAction { + AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager]; + self.inputAddressTf.text = sdk.locationAddressDetail; + + [self startSearchWithAddress:self.inputAddressTf.text]; +} + +-(void)startSearchWithAddress:(NSString *)addr { + if (!addr) { + return; + } + + AMapPOIKeywordsSearchRequest *request = [[AMapPOIKeywordsSearchRequest alloc] init]; + + request.keywords = addr; + + AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager]; + request.city = sdk.localCity; + + +// request.types = @"高等院校"; +// request.requireExtension = YES; + request.offset =20; + + /* 搜索SDK 3.2.0 中新增加的功能,只搜索本城市的POI。*/ + request.cityLimit = YES; +// request.requireSubPOIs = YES; + + + [self.search AMapPOIKeywordsSearch:request]; + +} + + +#pragma mark - +/* POI 搜索回调. */ +- (void)onPOISearchDone:(AMapPOISearchBaseRequest *)request response:(AMapPOISearchResponse *)response +{ + NSArray * pois = response.pois; + if (pois.count == 0) + { + return; + } + + //解析response获取POI信息,具体解析见 Demo + + self.dataArr = [NSArray arrayWithArray:pois]; + [self.tableView reloadData]; + +} + + + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + [textField resignFirstResponder]; + + [self startSearchWithAddress:textField.text]; + + return YES; +} + + + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + [self.inputAddressTf resignFirstResponder]; +} +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.h new file mode 100644 index 0000000..fb0e2ca --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.h @@ -0,0 +1,19 @@ +// +// AMapNavCommonUtil.h +// Pods +// +// Created by admin on 2026/2/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface AMapNavCommonUtil : NSObject + ++(UIImage *)imageWithName:(NSString *)name; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.m new file mode 100644 index 0000000..585f05b --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavCommonUtil.m @@ -0,0 +1,27 @@ +// +// AMapNavCommonUtil.m +// Pods +// +// Created by admin on 2026/2/11. +// + +#import "AMapNavCommonUtil.h" + +@implementation AMapNavCommonUtil + + +#pragma mark - 获取图片 ++(UIImage *)imageWithName:(NSString *)name { + NSURL * url = [[NSBundle mainBundle] URLForResource:@"AMapNavIOSSDK" withExtension:@"bundle"]; + NSBundle *containnerBundle = [NSBundle bundleWithURL:url]; + + NSString * path = [containnerBundle pathForResource:[NSString stringWithFormat:@"%@@2x.png" , name] ofType:nil]; + + UIImage * arrowImage = [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + return arrowImage; +} + + + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.h new file mode 100644 index 0000000..4aef2b2 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.h @@ -0,0 +1,19 @@ +// +// AMapNavHttpUtil.h +// AMapNavIOSSDK +// +// Created by admin on 2026/2/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface AMapNavHttpUtil : NSObject + ++ (void)postRequestWithURL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void ( ^)(NSError *error))failureHandler; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.m new file mode 100644 index 0000000..dd80c43 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapNavHttpUtil.m @@ -0,0 +1,114 @@ +// +// AMapNavHttpUtil.m +// AMapNavIOSSDK +// +// Created by admin on 2026/2/11. +// + +#import "AMapNavHttpUtil.h" + +#define AMapRequestMethod_POST @"POST" + +@interface AMapNavHttpUtil () +@property (nonatomic , copy) NSString * baseURL; +@end + +@implementation AMapNavHttpUtil + ++ (instancetype)sharedInstance { + static AMapNavHttpUtil *sharedInstance = nil; + static dispatch_once_t onceToken; + + // dispatch_once确保下面的代码块只被执行一次 + dispatch_once(&onceToken, ^{ + sharedInstance = [[self alloc] init]; + // 可以在这里进行一些初始化操作 + + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + +// if (sdk.config.developmentModel) { +// _baseURL = kYTOTPAnalyticsSDKTestHost; +// }else { +// _baseURL = kYTOTPAnalyticsSDKProductionHost; +// } + } + + return self; +} + + ++ (void)postRequestWithURL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void ( ^)(NSError *error))failureHandler { + [self requestWithMethod:AMapRequestMethod_POST URL:urlString parameters:parameters requestHeader:headParam successHandler:successHandler failureHandler:failureHandler]; +} + + +// 使用NSURLSession发起网络请求 ++ (void)requestWithMethod:(NSString *)method URL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void (^)(NSError *error))failureHandler { + if (!urlString) { + return; + } + + // 创建URL + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@" , urlString]]; + + // 创建请求 + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + request.HTTPMethod = method; + request.timeoutInterval = 30.0; + + // 设置请求头,指定数据通讯格式为json + if (headParam) { + for (NSString *key in headParam.allKeys) { + if (headParam[key]) { + [request setValue:[NSString stringWithFormat:@"%@",headParam[key]] forHTTPHeaderField:key]; + } + } + } + + // 将参数转换为JSON数据 + NSError *error; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]; + if (!jsonData) {} + + if ([method isEqualToString: AMapRequestMethod_POST]) { + // 设置请求体 + request.HTTPBody = jsonData; + } + + __block NSURLSession *session = [NSURLSession sharedSession]; + NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { + if (error) { + NSLog(@"request error:%@" , error); + if (failureHandler) { + failureHandler(error); + } + } else { + if (successHandler) { + NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil]; + if(dic){ + NSLog(@"url: %@ , response data:%@", url , dic); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + successHandler(dic, response); + }); +// successHandler(dic, response); + } + } + + [session finishTasksAndInvalidate]; + session = nil; + }]; + + // 开始任务 + [task resume]; +} + + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.h new file mode 100644 index 0000000..c9f7472 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.h @@ -0,0 +1,32 @@ +// +// AMapPrivacyUtility.h +// officialDemoNavi +// +// Created by menglong on 2021/10/29. +// Copyright © 2021 AutoNavi. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * 隐私合规使用demo 工具类 + */ +@interface AMapPrivacyUtility : NSObject + +/** + * @brief 通过这个方法来判断是否同意隐私合规 + * 1.如果没有同意隐私合规,则创建的SDK manager 实例返回 为nil, 无法使用SDK提供的功能 + * 2.如果同意了下次启动不提示 的授权,则不会弹框给用户 + * 3.如果只同意了,则下次启动还要给用户弹框提示 + */ + ++ (void)handlePrivacyAgreeStatus; + ++ (void)handlePrivacyAgreeStatusIn:(UIViewController*)targetVC; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.m new file mode 100644 index 0000000..3e96c97 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/AMapPrivacyUtility.m @@ -0,0 +1,137 @@ +// +// AMapPrivacyUtility.m +// officialDemoNavi +// +// Created by menglong on 2021/10/29. +// Copyright © 2021 AutoNavi. All rights reserved. +// + +#import "AMapPrivacyUtility.h" +#import +#import +@implementation AMapPrivacyUtility + ++ (void)showPrivacyInfoInWindow:(UIWindow *)window { + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + + paragraphStyle.alignment = NSTextAlignmentLeft; + + NSMutableAttributedString *privacyInfo = [[NSMutableAttributedString alloc] initWithString:@"\n亲,感谢您对XXX一直以来的信任!我们依据最新的监管要求更新了XXX《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供附近的商品、店铺及优惠资讯等)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{ + NSParagraphStyleAttributeName:paragraphStyle, + }]; + + [privacyInfo addAttribute:NSLinkAttributeName + value:@"《隐私权政策》" + range:[[privacyInfo string] rangeOfString:@"《隐私权政策》"]]; + + UIAlertController *privacyInfoController = [UIAlertController alertControllerWithTitle:@"温馨提示(隐私合规示例)" message:@"" preferredStyle:UIAlertControllerStyleAlert]; + + [privacyInfoController setValue:privacyInfo forKey:@"attributedMessage"]; + + + UIAlertAction *agreeAllAction = [UIAlertAction actionWithTitle:@"同意(下次不提示)" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"agreeStatus"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; + }]; + + + UIAlertAction *agreeAction = [UIAlertAction actionWithTitle:@"同意" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; + }]; + + UIAlertAction *notAgreeAction = [UIAlertAction actionWithTitle:@"不同意" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"agreeStatus"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusNotAgree]; + }]; + + [privacyInfoController addAction:agreeAllAction]; + [privacyInfoController addAction:agreeAction]; + [privacyInfoController addAction:notAgreeAction]; + + [window.rootViewController presentViewController:privacyInfoController animated:YES completion:^{ + //更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain]; + }]; + +} + ++ (void)handlePrivacyAgreeStatus { + //判断是否同意了隐私协议下次不提示 +// if(![[NSUserDefaults standardUserDefaults] boolForKey:@"agreeStatus"]){ + //添加隐私合规弹窗 + [self showPrivacyInfoInWindow:[UIApplication sharedApplication].delegate.window]; + +// [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; +// } +} + ++ (void)handlePrivacyAgreeStatusIn:(UIViewController*)targetVC { + if(![[NSUserDefaults standardUserDefaults] boolForKey:@"agreeStatus"]){ + [self showPrivacyInfoInWindowWithVC:targetVC]; + } +} + ++ (void)showPrivacyInfoInWindowWithVC:(UIViewController *)window { + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + + paragraphStyle.alignment = NSTextAlignmentLeft; + + NSMutableAttributedString *privacyInfo = [[NSMutableAttributedString alloc] initWithString:@"\n感谢您一直以来的信任!我们依据最新的监管要求更新了《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供附近的店铺及优惠资讯等)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{ + NSParagraphStyleAttributeName:paragraphStyle, + }]; + + [privacyInfo addAttribute:NSLinkAttributeName + value:@"《隐私权政策》" + range:[[privacyInfo string] rangeOfString:@"《隐私权政策》"]]; + + UIAlertController *privacyInfoController = [UIAlertController alertControllerWithTitle:@"温馨提示(隐私合规示例)" message:@"" preferredStyle:UIAlertControllerStyleAlert]; + + [privacyInfoController setValue:privacyInfo forKey:@"attributedMessage"]; + + + UIAlertAction *agreeAllAction = [UIAlertAction actionWithTitle:@"同意(下次不提示)" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"agreeStatus"]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"usragreeStatus"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; + + [NSNotificationCenter.defaultCenter postNotificationName:@"ksAMapPrivacyDidUpdateNotification" object:nil]; + }]; + + + UIAlertAction *agreeAction = [UIAlertAction actionWithTitle:@"同意" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"usragreeStatus"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; + [NSNotificationCenter.defaultCenter postNotificationName:@"ksAMapPrivacyDidUpdateNotification" object:nil]; + }]; + + UIAlertAction *notAgreeAction = [UIAlertAction actionWithTitle:@"不同意" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"agreeStatus"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + //更新用户授权高德SDK隐私协议状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusNotAgree]; + }]; + + [privacyInfoController addAction:agreeAllAction]; + [privacyInfoController addAction:agreeAction]; + [privacyInfoController addAction:notAgreeAction]; + + [window presentViewController:privacyInfoController animated:YES completion:^{ + //更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. since 8.1.0 + [[AMapNaviManagerConfig sharedConfig] updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain]; + }]; + +} + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.h new file mode 100644 index 0000000..a488be4 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.h @@ -0,0 +1,22 @@ +// +// NaviPointAnnotation.h +// AMapNaviKit +// +// Created by 刘博 on 16/3/8. +// Copyright © 2016年 AutoNavi. All rights reserved. +// + +#import + +typedef NS_ENUM(NSInteger, NaviPointAnnotationType) +{ + NaviPointAnnotationStart, + NaviPointAnnotationWay, + NaviPointAnnotationEnd +}; + +@interface NaviPointAnnotation : MAPointAnnotation + +@property (nonatomic, assign) NaviPointAnnotationType navPointType; + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.m new file mode 100644 index 0000000..81808f5 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/NaviPointAnnotation.m @@ -0,0 +1,13 @@ +// +// NaviPointAnnotation.m +// AMapNaviKit +// +// Created by 刘博 on 16/3/8. +// Copyright © 2016年 AutoNavi. All rights reserved. +// + +#import "NaviPointAnnotation.h" + +@implementation NaviPointAnnotation + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.h b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.h new file mode 100755 index 0000000..37c4b10 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.h @@ -0,0 +1,24 @@ +// +// SelectableOverlay.h +// officialDemo2D +// +// Created by yi chen on 14-5-8. +// Copyright (c) 2014年 AutoNavi. All rights reserved. +// + +#import +#import + +@interface SelectableOverlay : MABaseOverlay + +@property (nonatomic, assign) NSInteger routeID; + +@property (nonatomic, assign, getter = isSelected) BOOL selected; +@property (nonatomic, strong) UIColor * selectedColor; +@property (nonatomic, strong) UIColor * regularColor; + +@property (nonatomic, strong) id overlay; + +- (id)initWithOverlay:(id) overlay; + +@end diff --git a/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.m b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.m new file mode 100755 index 0000000..9c2aea9 --- /dev/null +++ b/ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.m @@ -0,0 +1,41 @@ +// +// SelectableOverlay.m +// officialDemo2D +// +// Created by yi chen on 14-5-8. +// Copyright (c) 2014年 AutoNavi. All rights reserved. +// + +#import "SelectableOverlay.h" + +@implementation SelectableOverlay + +#pragma mark - MAOverlay Protocol + +- (CLLocationCoordinate2D)coordinate +{ + return [self.overlay coordinate]; +} + +- (MAMapRect)boundingMapRect +{ + return [self.overlay boundingMapRect]; +} + +#pragma mark - Life Cycle + +- (id)initWithOverlay:(id)overlay +{ + self = [super init]; + if (self) + { + self.overlay = overlay; + self.selected = NO; + self.selectedColor = [UIColor colorWithRed:0.05 green:0.39 blue:0.9 alpha:0.8]; + self.regularColor = [UIColor colorWithRed:0.5 green:0.6 blue:0.9 alpha:0.8]; + } + + return self; +} + +@end diff --git a/ln_jq_app/ios/Podfile b/ln_jq_app/ios/Podfile index 466cfc9..42199c1 100644 --- a/ln_jq_app/ios/Podfile +++ b/ln_jq_app/ios/Podfile @@ -34,7 +34,7 @@ target 'Runner' do # use_frameworks! use_frameworks! :linkage => :static - pod 'AMapNavIOSSDK' , :path => '../../../../demo/ANavDemo/' + pod 'AMapNavIOSSDK' , :path => './AMapNavIOSSDK' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) diff --git a/ln_jq_app/ios/Podfile.lock b/ln_jq_app/ios/Podfile.lock index f002c02..8b5621d 100644 --- a/ln_jq_app/ios/Podfile.lock +++ b/ln_jq_app/ios/Podfile.lock @@ -59,7 +59,7 @@ PODS: DEPENDENCIES: - aliyun_push_flutter (from `.symlinks/plugins/aliyun_push_flutter/ios`) - - AMapNavIOSSDK (from `../../../../demo/ANavDemo/`) + - AMapNavIOSSDK (from `./AMapNavIOSSDK`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) @@ -93,7 +93,7 @@ EXTERNAL SOURCES: aliyun_push_flutter: :path: ".symlinks/plugins/aliyun_push_flutter/ios" AMapNavIOSSDK: - :path: "../../../../demo/ANavDemo/" + :path: "./AMapNavIOSSDK" connectivity_plus: :path: ".symlinks/plugins/connectivity_plus/ios" device_info_plus: @@ -148,6 +148,6 @@ SPEC CHECKSUMS: shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6 url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa -PODFILE CHECKSUM: aba49f58e1bc68a5558fc761b5370b90e7cb7e2b +PODFILE CHECKSUM: 97188da9dab9d4b3372eb4c16e872fbd555fdbea COCOAPODS: 1.16.2