iOS百度地图 定位,获取当前经纬度
2017-08-22 14:39
525 查看
百度地图定位
.集成百度地图SDK http://blog.csdn.net/chuan403082010/article/details/77478182
.开始定位 官网链接: http://lbsyun.baidu.com/index.php?title=iossdk/guide/location
在info.plist里 设置开启定位权限
Privacy - Location When In Use Usage Description 或Privacy - Location Always Usage Description
.集成百度地图SDK http://blog.csdn.net/chuan403082010/article/details/77478182
.开始定位 官网链接: http://lbsyun.baidu.com/index.php?title=iossdk/guide/location
#import "ViewController.h" #import <BaiduMapAPI_Location/BMKLocationService.h> @interface ViewController ()<BMKLocationServiceDelegate> @property (strong, nonatomic) BMKLocationService * locService;//定位 @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; _locService = [[BMKLocationService alloc]init]; _locService.delegate = self; [_locService startUserLocationService]; // Do any additional setup after loading the view, typically from a nib. } /** *用户方向更新后,会调用此函数 *@param userLocation 新的用户位置 */ - (void)didUpdateUserHeading:(BMKUserLocation *)userLocation { NSLog(@"方向更新%f %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude); } /** *用户位置更新后,会调用此函数 *@param userLocation 新的用户位置 */ - (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation{ NSLog(@"位置更新%f %f",userLocation.location.coordinate.latitude,userLocation.location.coordinate.longitude); } /** *定位失败后,会调用此函数 *@param error 错误号 */ - (void)didFailToLocateUserWithError:(NSError *)error{ NSLog(@"定位失败%@",error); } @end
在info.plist里 设置开启定位权限
Privacy - Location When In Use Usage Description 或Privacy - Location Always Usage Description
相关文章推荐
- iOS - (利用/调用系统定位获取当前经纬度与地理信息)
- ios开发之 -- 调用系统定位获取当前经纬度与地理信息
- iOS_经纬度定位及反编码获取当前地址
- iOS定位获取当前所在经纬度,进而获得具体地址(省市地区街道)
- android使用百度地图定位(获取当前经纬度和地址信息)
- IOS 百度地图获取当前屏幕的经纬度
- Android使用百度地图定位(获取当前经纬度和地址信息)
- iOS定位获取当前所在经纬度,进而获得具体地址(省市地区街道)
- iOS - (利用/调用系统定位获取当前经纬度与地理信息)
- ios开发之 -- 调用系统定位获取当前经纬度与地理信息
- iOS定位获取当前所在经纬度,进而获得具体地址(省市地区街道)
- android使用百度地图定位(获取当前经纬度和地址信息)
- ios项目开发(天气预报项目):通过经纬度获取当前城市名称
- iOS定位操作,获取当前位置,计算两点之间距离
- 【iOS百度地图系列_1】在地图上定位当前位置
- iOS定位服务系列之一:获取当前位置信息
- iOS定位操作,获取当前位置
- Geolocation获取当前位置的经纬度在百度地图中就是比google地图中精确的原因
- 根据HTML5 获取当前位置的经纬度【百度地图】【高德地图】
- 百度定位SDK实现获取当前经纬度及位置