BaiduLoc_IOSSDK_v2.0.9_Docs  2.0.9
构造函数 | 属性 | 所有成员列表
BMKGeoFenceManager类 参考

地理围栏管理类 更多...

#import <BMKGeoFenceManager.h>

类 BMKGeoFenceManager 继承关系图:

构造函数

(void) - addCircleRegionForMonitoringWithCenter:radius:coorType:customID:
 添加一个圆形围栏 更多...
 
(void) - addPolygonRegionForMonitoringWithCoordinates:count:coorType:customID:
 根据经纬度坐标数据添加一个闭合的多边形围栏,点与点之间按顺序尾部相连, 第一个点与最后一个点相连 更多...
 
(NSArray *_Nullable) - geoFenceRegionsWithCustomID:
 根据customID获得指定的围栏,如果customID传nil,则返回全部围栏 更多...
 
(void) - removeTheGeoFenceRegion:
 移除指定围栏 更多...
 
(void) - removeGeoFenceRegionsWithCustomID:
 移除指定customID的围栏 更多...
 
(void) - removeAllGeoFenceRegions
 移除所有围栏 更多...
 

属性

id< BMKGeoFenceManagerDelegate > delegate
 实现了 BMKGeoFenceManagerDelegate 协议的类指针。 更多...
 
BMKGeoFenceActiveAction activeAction
 需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。 更多...
 
CLLocationDistance distanceFilter
 设定定位的最小更新距离。默认为 kCLDistanceFilterNone。 更多...
 
CLLocationAccuracy desiredAccuracy
 设定定位精度。默认为 kCLLocationAccuracyBest。 更多...
 
CLActivityType activityType
 设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。 更多...
 
BOOL pausesLocationUpdatesAutomatically
 指定定位是否会被系统自动暂停。默认为NO。 更多...
 
BOOL allowsBackgroundLocationUpdates
 是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。 更多...
 

详细描述

地理围栏管理类

函数文档

◆ addCircleRegionForMonitoringWithCenter:radius:coorType:customID:

- (void) addCircleRegionForMonitoringWithCenter: (CLLocationCoordinate2D)  center
radius: (CLLocationDistance)  radius
coorType: (BMKLocationCoordinateType)  type
customID: (NSString *_Nullable)  customID 

添加一个圆形围栏

参数
center围栏的中心点经纬度坐标
radius围栏的半径,单位:米,要求大于0
type围栏的坐标系类型
customID用户自定义ID,可选,SDK原值返回

◆ addPolygonRegionForMonitoringWithCoordinates:count:coorType:customID:

- (void) addPolygonRegionForMonitoringWithCoordinates: (CLLocationCoordinate2D *_Nonnull)  coordinates
count: (NSInteger)  count
coorType: (BMKLocationCoordinateType)  type
customID: (NSString *_Nullable)  customID 

根据经纬度坐标数据添加一个闭合的多边形围栏,点与点之间按顺序尾部相连, 第一个点与最后一个点相连

参数
coordinates经纬度坐标点数据,coordinates对应的内存会拷贝,调用者负责该内存的释放
count经纬度坐标点的个数,不可小于3个
type围栏的坐标系类型
customID用户自定义ID,可选,SDK原值返回

◆ geoFenceRegionsWithCustomID:

- (NSArray * _Nullable) geoFenceRegionsWithCustomID: (NSString *_Nullable)  customID

根据customID获得指定的围栏,如果customID传nil,则返回全部围栏

参数
customID用户执行添加围栏函数时传入的customID
返回
获得的围栏构成的数组,如果没有结果,返回nil

◆ removeAllGeoFenceRegions

- (void) removeAllGeoFenceRegions

移除所有围栏

◆ removeGeoFenceRegionsWithCustomID:

- (void) removeGeoFenceRegionsWithCustomID: (NSString *_Nullable)  customID

移除指定customID的围栏

参数
customID用户执行添加围栏函数时传入的customID

◆ removeTheGeoFenceRegion:

- (void) removeTheGeoFenceRegion: (BMKGeoFenceRegion *_Nonnull)  region

移除指定围栏

参数
region要停止监控的围栏

属性说明

◆ activeAction

- (BMKGeoFenceActiveAction) activeAction
readwritenonatomicassign

需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。

◆ activityType

- (CLActivityType) activityType
readwritenonatomicassign

设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。

◆ allowsBackgroundLocationUpdates

- (BOOL) allowsBackgroundLocationUpdates
readwritenonatomicassign

是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。

◆ delegate

- (id<BMKGeoFenceManagerDelegate>) delegate
readwritenonatomicweak

实现了 BMKGeoFenceManagerDelegate 协议的类指针。

◆ desiredAccuracy

- (CLLocationAccuracy) desiredAccuracy
readwritenonatomicassign

设定定位精度。默认为 kCLLocationAccuracyBest。

◆ distanceFilter

- (CLLocationDistance) distanceFilter
readwritenonatomicassign

设定定位的最小更新距离。默认为 kCLDistanceFilterNone。

◆ pausesLocationUpdatesAutomatically

- (BOOL) pausesLocationUpdatesAutomatically
readwritenonatomicassign

指定定位是否会被系统自动暂停。默认为NO。


该类的文档由以下文件生成: