高德地图SDK(定位)  V2.10.0
AMapGeoFenceManager.h
Go to the documentation of this file.
1 //
2 // AMapGeoFenceManager.h
3 // AMapLocationKit
4 //
5 // Created by hanxiaoming on 16/12/5.
6 // Copyright © 2016年 Amap. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
11 
12 // 以下类涉及的坐标需要使用高德坐标系坐标(GCJ02)
13 
15 
17 typedef NS_OPTIONS(NSUInteger, AMapGeoFenceActiveAction)
18 {
19  AMapGeoFenceActiveActionNone = 0,
20  AMapGeoFenceActiveActionInside = 1 << 0,
21  AMapGeoFenceActiveActionOutside = 1 << 1,
22  AMapGeoFenceActiveActionStayed = 1 << 2,
23 };
24 
26 typedef NS_OPTIONS(NSUInteger, AMapGeoFenceRegionActiveStatus)
27 {
28  AMapGeoFenceRegionActiveUNMonitor = 0,
29  AMapGeoFenceRegionActiveMonitoring = 1 << 0,
30  AMapGeoFenceRegionActivePaused = 1 << 1,
31 };
32 
34 @interface AMapGeoFenceManager : NSObject
35 
36 
38 @property (nonatomic, weak) id<AMapGeoFenceManagerDelegate> delegate;
39 
40 
42 @property (nonatomic, assign) AMapGeoFenceActiveAction activeAction;
43 
44 
46 @property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
47 
48 
50 @property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
51 
53 @property (nonatomic, assign) BOOL detectRiskOfFakeLocation;
54 
55 
62 - (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius customID:(NSString *)customID;
63 
64 
71 - (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSInteger)count customID:(NSString *)customID;
72 
73 
82 - (void)addKeywordPOIRegionForMonitoringWithKeyword:(NSString *)keyword POIType:(NSString *)type city:(NSString *)city size:(NSInteger)size customID:(NSString *)customID;
83 
84 
94 - (void)addAroundPOIRegionForMonitoringWithLocationPoint:(CLLocationCoordinate2D)locationPoint aroundRadius:(NSInteger)aroundRadius keyword:(NSString *)keyword POIType:(NSString *)type size:(NSInteger)size customID:(NSString *)customID;
95 
96 
102 - (void)addDistrictRegionForMonitoringWithDistrictName:(NSString *)districtName customID:(NSString *)customID;
103 
109 - (AMapGeoFenceRegionActiveStatus)statusWithGeoFenceRegion:(AMapGeoFenceRegion *)region;
110 
116 - (NSArray *)geoFenceRegionsWithCustomID:(NSString *)customID;
117 
123 - (NSArray *)monitoringGeoFenceRegionsWithCustomID:(NSString *)customID;
124 
130 - (NSArray *)pausedGeoFenceRegionsWithCustomID:(NSString *)customID;
131 
132 
138 - (NSArray *)pauseGeoFenceRegionsWithCustomID:(NSString *)customID;
139 
140 
146 - (BOOL)pauseTheGeoFenceRegion:(AMapGeoFenceRegion *)region;
147 
153 - (NSArray *)startGeoFenceRegionsWithCustomID:(NSString *)customID;
154 
160 - (BOOL)startTheGeoFenceRegion:(AMapGeoFenceRegion *)region;
161 
166 - (void)removeTheGeoFenceRegion:(AMapGeoFenceRegion *)region;
167 
172 - (void)removeGeoFenceRegionsWithCustomID:(NSString *)customID;
173 
178 
179 @end
180 
182 @protocol AMapGeoFenceManagerDelegate <NSObject>
183 
184 @required
185 
186 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
187 
200 - (void)amapLocationManager:(AMapGeoFenceManager *)manager doRequireTemporaryFullAccuracyAuth:(CLLocationManager*)locationManager completion:(void(^)(NSError *error))completion;
201 
202 #endif
203 
204 @optional
205 
213 - (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager doRequireLocationAuth:(CLLocationManager*)locationManager;
214 
222 - (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager didAddRegionForMonitoringFinished:(NSArray <AMapGeoFenceRegion *> *)regions customID:(NSString *)customID error:(NSError *)error;
223 
224 
232 - (void)amapGeoFenceManager:(AMapGeoFenceManager *)manager didGeoFencesStatusChangedForRegion:(AMapGeoFenceRegion *)region customID:(NSString *)customID error:(NSError *)error;
233 
234 @end
AMapGeoFenceManager::activeAction
AMapGeoFenceActiveAction activeAction
需要进行通知的行为,默认为AMapGeoFenceActiveActionInside。
Definition: AMapGeoFenceManager.h:42
AMapGeoFenceRegionObj.h
AMapGeoFenceManagerDelegate-p
地理围栏代理协议(since 2.3.0),该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
Definition: AMapGeoFenceManager.h:182
AMapGeoFenceManager::detectRiskOfFakeLocation
BOOL detectRiskOfFakeLocation
检测是否存在虚拟定位风险,默认为NO,即不检测。 如果设置为YES,检测到风险后,会通过amapGeoFenceManager:didGeoFencesStatusChangedForRegion:c...
Definition: AMapGeoFenceManager.h:53
AMapGeoFenceManager::delegate
id< AMapGeoFenceManagerDelegate > delegate
实现了 AMapGeoFenceManagerDelegate 协议的类指针。
Definition: AMapGeoFenceManager.h:38
AMapGeoFenceManager::allowsBackgroundLocationUpdates
BOOL allowsBackgroundLocationUpdates
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
Definition: AMapGeoFenceManager.h:50
AMapGeoFenceRegion
地理围栏基类,不可直接使用。(since 2.3.0)
Definition: AMapGeoFenceRegionObj.h:33
AMapGeoFenceManager
地理围栏管理类(since 2.3.0)
Definition: AMapGeoFenceManager.h:35
AMapGeoFenceManager::pausesLocationUpdatesAutomatically
BOOL pausesLocationUpdatesAutomatically
指定定位是否会被系统自动暂停。默认为NO。
Definition: AMapGeoFenceManager.h:46
NS_OPTIONS
typedef NS_OPTIONS(NSUInteger, AMapGeoFenceActiveAction)
地理围栏监听状态类型
Definition: AMapGeoFenceManager.h:17
-[AMapGeoFenceManager removeAllGeoFenceRegions]
void removeAllGeoFenceRegions()
移除所有围栏
© 2017 高德信息技术有限公司 版权所有,保留所有权利。