地理围栏
来源:互联网 发布:易语言彩票表格源码 编辑:程序博客网 时间:2024/04/27 16:29
//配置位置管理器
-(void)managerLocation{
if (!self.locationManager) {
self.locationManager = [[CLLocationManager alloc] init];
}
//兼容8.0以前的版本
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
//授权状态没有询问用户
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
[self.locationManager requestAlwaysAuthorization];
}
}
//GPS硬件打开
if (![CLLocationManager locationServicesEnabled]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"PGS 未打开!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil , nil];
[alert show];
}
self.locationManager.delegate = self;
//设置精确度
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
//设置距离的过滤
self.locationManager.distanceFilter = 15.f;
-(void)managerLocation{
if (!self.locationManager) {
self.locationManager = [[CLLocationManager alloc] init];
}
//兼容8.0以前的版本
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
//授权状态没有询问用户
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
[self.locationManager requestAlwaysAuthorization];
}
}
//GPS硬件打开
if (![CLLocationManager locationServicesEnabled]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"PGS 未打开!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil , nil];
[alert show];
}
self.locationManager.delegate = self;
//设置精确度
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
//设置距离的过滤
self.locationManager.distanceFilter = 15.f;
}
## 开始监测
- (IBAction)begin:(id)sender {
//构造监听区域
CLRegion *region = [[CLCircularRegion alloc] initWithCenter:CLLocationCoordinate2DMake(34.77, 113.76887056) radius:1000.f identifier:@"first"];
[self.locationManager startMonitoringForRegion:region];
//开始位置监听
[self.locationManager startUpdatingLocation];
//添加一个圆形的覆盖层
MKCircle *circle = [MKCircle circleWithCenterCoordinate:CLLocationCoordinate2DMake(34.77, 113.76887056) radius:1000.f];
[self.mapView addOverlay:circle];
}
0 0
- 地理围栏
- 何为“地理围栏”
- 地理围栏算法解析
- 地理围栏算法解析
- iOS开发-定位服务和地理围栏
- CoreLocation、MapKit和地理围栏1
- 地理围栏算法解析(Geo-fencing)
- 高德地图——地理围栏
- iOS 高德地图 地理围栏
- 百度地图API实现地理围栏
- 陈志刚:地理围栏是运营商LBS的未来
- iOS开发-地图中地理围栏的使用,等待写。。。。
- 【开发小谈】百度地图术语总结 反地理编码的意思 地理围栏的意思
- 在 Android* 商务应用中实施地图和地理围栏特性
- 在 Android* 商务应用中实施地图和地理围栏特性(抄录下来的)
- 给定坐标点,判断是否在某区域范围内 地理围栏算法
- iOS开发笔记之五十六——Geofencing地理围栏技术介绍
- Android百度地图(五):百度地图鹰眼sdk监控进出地理围栏(区域)
- AndroidAnnoatations 标注框架的学习的配置
- 定制导航栏
- 估计概率构造短语翻译表
- Linux常用参数
- 使用内部的方法来实现HTTP请求
- 地理围栏
- 字节数据转换成十六进制字符串
- Linux文件与目录的命令
- Codeforces 448C Painting Fence
- java 日期格式化帮助类
- android Launcher4 给第三方应用图标添加底图
- Maven入门指南① :Maven 快速入门及简单使用
- Java编码约定
- 1248: HH的军训[容斥定理]