1.ios中自带的地图为高德地图
1>.添加框架CoreLocation.framework框架。
2>.添加头文件:#import<CoreLocation/CoreLocation.h>
3>.添加代理:<CLLocationManagerDelegate>
4>.在Info.Plist里添加:Privacy - Location Always Usage Description
2.代码:
1>初始化代码:
if(!_locationManager){
self.locationManager = [[CLLocationManageralloc] init];
if([self.locationManagerrespondsToSelector:@selector(requestWhenInUseAuthorization)]){
[self.locationManagerrequestWhenInUseAuthorization];
[