首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大师级码师

    ios输入地址得出经纬度

    ios输入地址得出经纬度 CLGeocoder *myGeocoder = [[CLGeocoder alloc] init]; [myGeocoder geocodeAddressString:_searchBar.text

    54000发布于 2021-10-31
  • 来自专栏ppppy_oschina

    iOS原生定位和反编码

    locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{ NSLog(@"定位到了"); CLGeocoder *geocoder = [[CLGeocoder alloc]init]; [geocoder reverseGeocodeLocation:[locations firstObject] completionHandler

    69430编辑于 2022-11-15
  • 来自专栏全栈程序员必看

    IOS-导航路线_iphone导航

    nonatomic) IBOutlet UITextField *endField; 23 /** 24 * 地理编码对象 25 */ 26 @property(nonatomic, strong) CLGeocoder 105 [MKMapItem openMapsWithItems:items launchOptions:md]; 106 } 107 108 #pragma mark - 懒加载 109 - (CLGeocoder _geocoder) { 112 self.geocoder = [[CLGeocoder alloc] init]; 113 } 114 return _geocoder; 115 } 116 117 _geocoder) { 135 self.geocoder = [[CLGeocoder alloc] init]; 136 } 137 return _geocoder; 138 } 139 140 _geocoder) { 170 self.geocoder = [[CLGeocoder alloc] init]; 171 } 172 return _geocoder; 173 } 174 175

    1K20编辑于 2022-09-20
  • 来自专栏学海无涯

    iOS开发之定位

    CLGeocoder:地理编码,分为两种 正向地理编码:根据位置信息,获取具体的经纬度等信息 反向地理编码:根据给定的经纬度等信息,获取位置信息 CLPlacemark:位置信息,包含的信息如国家、 CLLocationManager发起定位,定位成功或者失败都会回调CLLocationManagerDelegate中相应的代理方法 (2)在成功的代理方法中获取 CLLocation 对象,进而获取经纬度 (3)通过 CLGeocoder CLLocation]) { let location = locations.last //地理编码的类 let gecoder = CLGeocoder

    1.9K10发布于 2019-03-21
  • 来自专栏全栈程序员必看

    ios项目开发(天气预报项目):通过经纬度获取当前城市名称

    #import <coreLocation/CLGeocoder.h> 4.#import <coreLocation/CLPlacemark.h> 3 . CLGeocoder *geocoder = [[CLGeocoder alloc] init]; 11.

    91320编辑于 2022-07-11
  • 来自专栏大宇笔记

    swift 定位封装一句话使用

    (nil,nil,"定位失败===\(error)") } ///经纬度逆编 func LonLatToCity() { let geocoder: CLGeocoder = CLGeocoder() geocoder.reverseGeocodeLocation(self.curLocation!)

    1.6K20发布于 2019-01-15
  • 来自专栏滕先生的博客

    地图相关 MapKit框架介绍MKMapView控件对象的属性和方法MKAnnotation 大头针模型类大头针view显示类:MKPinAnnotationView 继承于 MKAnnotation

    创建地理编码对象 CLGeocoder *geocoder = [CLGeocoder new]; //2. 创建CLGeocoder对象 CLGeocoder *geocoder = [CLGeocoder new]; //2. 创建CLGeocoder对象 CLGeocoder *geocoder = [CLGeocoder new]; //2.

    5.7K70发布于 2018-05-18
  • 来自专栏青玉伏案

    iOS开发之地图与定位

    23 24 25 __block __weak ViewController *copy_self = self; 26 27 //解析地理位置 28 CLGeocoder *geocoder = [[CLGeocoder alloc] init]; 29 [geocoder reverseGeocodeLocation:location completionHandler

    1.9K60发布于 2018-01-11
  • 来自专栏mukekeheart的iOS之旅

    iOS学习——自动定位

    [locationManager stopUpdatingLocation]; CLLocation *currentLoc = [locations lastObject]; CLGeocoder *geoCoder = [[CLGeocoder alloc] init]; //利用经纬度进行反编译获取位置信息 [geoCoder reverseGeocodeLocation:currentLoc

    1.2K100发布于 2018-03-26
  • 来自专栏iOS开发~

    iOS_系统自带地图圆形区域选择范围

    return; } } #pragma mark - 点击搜索 - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { CLGeocoder *geocoder = [[CLGeocoder alloc]init]; NSString *addressStr = searchBar.text; //位置信息 // 地理编码 [ 反地理编码 } #pragma mark - 反地理编码 (更新label text) - (void)reverseGeocodeWith:(CLLocation *)location { CLGeocoder *gecoder = [[CLGeocoder alloc] init]; __weak typeof(self) weakSelf = self; [gecoder reverseGeocodeLocation

    2.8K10编辑于 2022-07-20
  • 来自专栏码客

    iOS地图开发1-定位(swift)

    CLLocationManagerDelegate (2)定义全局变量地址管理与坐标解析 let locationManager:CLLocationManager = CLLocationManager() let geocoder:CLGeocoder = CLGeocoder(); (3)初始化设置 locationManager.delegate = self //精确到10米,距离过滤器,定义了设备移动后获得位置信息的最小距离 locationManager.desiredAccuracy

    2K10发布于 2019-10-22
  • 来自专栏iOSer成长记录

    iOS-CoreLocation框架的定位和逆地址解析详解

    // 计算两个点之间的距离 open func distance(from location: CLLocation) -> CLLocationDistance 四、逆地址解析 我们使用CLGeocoder 实现逆地址解析,而且非常简单,如下 func reverseGeocodeLocation(location:CLLocation){ let geocoder = CLGeocoder() didUpdateLocations获取后立即传入进来的 case1:传过来后立即传入 reverseGeocodeLocation逆解析,此时所有系统都不会有问题,如下代码 let geocoder = CLGeocoder

    1.7K20发布于 2018-06-29
  • 来自专栏全栈程序员必看

    CLLocation定位

    —\(status.rawValue)”) } func lonlatToCity(_ location: CLLocation) { let geocoder: CLGeocoder = CLGeocoder() geocoder.reverseGeocodeLocation(location) { [weak self](placemarks, error) in

    84820编辑于 2022-09-17
  • 来自专栏iOS开发攻城狮的集散地

    iOS 仿系统指南针

    NSString stringWithFormat:@"纬度:%@ 经度:%@ 海拔:%@", latitudeStr, longitudeStr, altitudeStr]; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder reverseGeocodeLocation:self.currLocation

    1.5K50发布于 2018-05-22
  • 来自专栏滕先生的博客

    地图相关 CoreLocation框架介绍请求用户授权方法CLLocationManager 属性和方法CLLocation 位置对象介绍三、地理编码的实现

    应该给用户一个列表选择 反地理编码:将经纬度转换成地名的过程 步骤: (1)创建一个GLGeocoder对象 (2)创建一个CLLoction对象(经纬度) (3)实现反地理编码方法 (4)遍历数组,获取数组 CLGeocoder 创建 Geocoder CLGeocoder *geocoder = [CLGeocoder new]; //2. 创建 Geocoder 对象 CLGeocoder *geocoder = [CLGeocoder new]; //2.

    2.3K120发布于 2018-05-18
  • 来自专栏学海无涯

    iOS14开发-定位与地图

    CLGeocoder:地理编码。 工作流程 创建CLLocationManager,设置代理并发起定位。 实现CLLocationManagerDelegate中定位成功和失败的代理方法。 在成功的代理方法中获取CLLocation对象并通过CLGeocoder进行反向地理编码获取对应的位置信息CLPlacemark。 通过CLPlacemark获取具体的位置信息。 UIViewController { // CLLocationManager lazy var locationManager = CLLocationManager() // CLGeocoder lazy var gecoder = CLGeocoder() override func viewDidLoad() { super.viewDidLoad() location = CLLocation(latitude: coordinate.latitude, longitude: coordinate.longitude) let gecoder = CLGeocoder

    3.5K30发布于 2021-07-14
  • 来自专栏全栈程序员必看

    iOS关于地图定位基础(二)[通俗易懂]

    (@"离开区域state"); break; default: break; } } @end (三、地理编码&反编码)最后我们聊聊地理编码和反编码,用到的核心类是CoreLocation 框架中的CLGeocoder CoreLocation/CoreLocation.h> @interface ViewController () /** 地理编码器 */ @property (strong, nonatomic) CLGeocoder nonatomic) IBOutlet UITextField *clLongitude; @end @implementation ViewController #pragma mark - lazy - (CLGeocoder _geocoder) { _geocoder = [[CLGeocoder alloc] init]; } return _geocoder; } // 地理编码 - (IBAction)geoClick

    1.5K20编辑于 2022-09-17
  • 来自专栏移动开发面面观

    iOS学习笔记——LBS

    locationManager stopUpdatingLocation]; CLLocation *currentLocation = [locations lastObject]; CLGeocoder *geoCoder = [[CLGeocoder alloc]init]; //当前的经纬度 NSLog(@"当前的经纬度 %f,%f",currentLocation.coordinate.latitude

    2.2K30发布于 2018-07-03
  • 来自专栏全栈程序员必看

    iOS开发-用户定位获取-CoreLocation的实际应用-CLLocationManger获取定位权限-CLLocation详细使用方式

    苹果提供了一个CLGeocoder类,这个类是用于在地理坐标和地名之间转换的接口,也就是常说的逆地理编码(反地理编码) // 反地理编码(根据当前的经纬度获取具体的位置信息) CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray

    5.7K20编辑于 2022-09-17
  • 来自专栏xx_Cc的学习总结专栏

    iOS-世界那么大,CoreLocation带你去看看

    使用CLGeocoder来获取。 CLGeocoder 的使用 // 创建 CLGeocoder *geocoder = [[CLGeocoder alloc]init]; // 地理编码 [self.geocoder geocodeAddressString

    1.8K90发布于 2018-05-10
领券