正在进行的项目中有这样的需求:定位获得当前经纬度,再用百度Place API使用经纬度查询周边信息。这里不需要显示地图,只需要定位。看似思路很顺畅,做起来却不容易。
iPhone的GPS定位(CLLocationManager)获得的经纬坐标是基于WGS-84坐标系(世界标准),Google地图使用的是GCJ-02坐标系(中国特色的火星坐标系),这就是为什么获得的经纬坐标在goo...
分类:
移动开发 时间:
2015-04-20 09:38:25
阅读次数:
204
应该是这样去解决的。IOS8以后,需要在info.plist文件里面加NSLocationWhenInUseDescription或NSLocationAlwaysUsageDescription。后面的描述随便加。IOS以后需要到CLLocationManager得代理- (void)locati...
分类:
移动开发 时间:
2015-04-13 22:35:42
阅读次数:
219
- (CLLocationManager *)locationManager{ if (!_locationManager) { _locationManager = [[CLLocationManager alloc] init]; _locationManage...
分类:
其他好文 时间:
2015-04-08 19:39:02
阅读次数:
111
在iOS开发中,用到定位时经常会遇到这个头疼的问题:系统语言为英文时返回英文或拼音,系统语言是中文时才返回中文。下面是强制系统获取的定位地点为中文。方案是网上的,但优化了一下,当逆地理编码结束后才恢复系统语言,避免一些极端情况下的不生效问题。实测可行。有问题欢迎留言。`-(void)locationManager:(CLLocationManager *)manager didUpdateToLoc...
分类:
移动开发 时间:
2015-04-07 13:54:52
阅读次数:
156
iOS8中使用CoreLocation定位
1、在使用CoreLocation前需要调用如下函数【iOS8专用】:
iOS8对定位进行了一些修改,其中包括定位授权的方法,CLLocationManager增加了下面的两个方法:
(1)始终允许访问位置信息
-
(void)requestAlwaysAuthorization;
(2)使用应用程序期间允许访问位置数据...
分类:
移动开发 时间:
2015-04-03 19:31:50
阅读次数:
148
如果是xcode6和ios 8的话,需要调用 CLLocationManager requestAlwaysAuthorization 方法,具体步骤如下: 1. @interface里: ? ?CLLocationManager *locationManager; 2. 初始化: ? ?locationManager = [[C...
分类:
移动开发 时间:
2015-04-02 15:16:32
阅读次数:
131
关键点:- (void)locationManager:(CLLocationManager*)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status代理方法 iOS7环境下当APP首次调用startUpdatin...
分类:
移动开发 时间:
2015-03-30 16:05:14
阅读次数:
130
在 iOS 8 上编译会出现以下 log : Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationMa...
分类:
移动开发 时间:
2015-03-18 07:52:49
阅读次数:
189
1.在info.plist中添加key?NSLocationWhenInUseUsageDescription、NSLocationAlwaysUsageDescription。 2.CLLocationManager 切记定义成成员变量、或者属性,否则导致不弹出系统提示打开定位提示框 3.直接上代码 ...
分类:
移动开发 时间:
2015-02-02 14:19:10
阅读次数:
178
iOS8中定位服务的变化(CLLocationManager协议方法不响应,无法回掉GPS方法,不出现获取权限提示) 最近在写一个LBS的项目的时候,因为考虑到适配iOS8,就将项目迁移到Xcode6.0.1上,出现了不能正常获取定位服务权限...
分类:
移动开发 时间:
2015-01-28 14:54:50
阅读次数:
206