iOS 地图定位 简述

NSLocationAlwaysUsageDescription  始终使用定位

NSLocationUsageDescription  是否同意定位

NSLocationWhenInUseUsageDescription  在前台使用定位


CLLocationManager

1 定位权限

A 隐式获取权限

    [locationManager startUpdatingLocation]

显示获取权限

    if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {

        

        [locationManager requestWhenInUseAuthorization];

    }

 

是否已经决定了定位权限


    + (BOOL)authorizationDetermined {

        

        return [CLLocationManager authorizationStatus] != kCLAuthorizationStatusNotDetermined;

    }

获得的定位权限是什么


    + (BOOL)authorized {

 

        return [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized ||

               [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedAlways ||

               [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse;

    }

 

    + (BOOL)denined {

        return [CLLocationManager authorizationStatus] == KCLAuthorizationStatusDenied;

    }


 

CLLocation


经纬度 CLLocationCoordinate2D coordinate;

海拔  CLLocationDistance altitude;

航向  CLLocationDirection course;

速度  CLLocationSpeed speed;

误差半径 (定位精度) CLLocationAccuracy horizontalAccuracy;


CLPlacemark


地里位置 CLLocation *location;

区域    CLRegion *region;

详细地址 NSDictionary *addressDictionary;

地址名称 NSString *name;

城市    NSString *locality;




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值