IOS8下,百度地图无法定位解决办法

最近项目中用到了百度地图定位 发现IOS8+的真机测试并没有办法定位 应该是百度自己的问题

 

1. 在info.plist中加入以下两个属性:
NSLocationAlwaysUsageDescription=YES
NSLocationWhenInUseUsageDescription=YES

2. 在调用百度地图定位之前,加上如下代码:

1 if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
2         
3         CLLocationManager *locationManager = [[CLLocationManager alloc] init];
4         
5         [locationManager requestAlwaysAuthorization];
6         [locationManager requestWhenInUseAuthorization];
7         
8     }

 

posted @ 2015-06-23 17:42  安钲熙  阅读(353)  评论(0编辑  收藏  举报