地图与定位之地理编码
2015-04-16 16:49
253 查看
定位学习之后学习地理编码和反编码。
地址要写大点的地址,小地址找不到
#import "ViewController.h" #import <CoreLocation/CoreLocation.h> @interface ViewController ()<CLLocationManagerDelegate> @property(nonatomic,strong)CLGeocoder *cLGeocoder; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSString *address=@"天安门"; CLLocation *clLocation=[[CLLocation alloc]initWithLatitude:39.54 longitude:116.28]; _cLGeocoder=[[CLGeocoder alloc]init]; //编码 [_cLGeocoder geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark=[placemarks firstObject]; CLLocation *cllocation=placemark.location; CLRegion *clRegion=placemark.region; NSDictionary *addressdic=placemark.addressDictionary; NSLog(@"编码: %@ %@ %@",cllocation,clRegion,addressdic); }]; //反编码 [_cLGeocoder reverseGeocodeLocation:clLocation completionHandler:^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark=[placemarks firstObject]; NSLog(@"反编码: %@",placemark); }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
地址要写大点的地址,小地址找不到
相关文章推荐
- iOS定位服务与地图开发(2)---地理信息反编码
- swift 地图定位(七)地理编码与反地理编码
- iOS定位服务与地图开发(3)---地理信息编码查询
- iOS开发地图定位及地理编码
- iOS.定位服务与地图应用.02.地理信息反编码
- 地图(定位、POI、地理编码……)
- iOS百度地图简单应用( iOS地图定位(定位、地理编码与反地理编码、mapView、大头针)
- iOS.定位服务与地图应用.03.地理信息编码查询
- iOS开发——高德地图调研之显示地图、定位与地理编码等
- iOS开发:高德地图显示、定位、反地理编码
- 地图的相关使用(定位,地理编码,导航)
- 地图定位 - 定位,持续定位设置,比较两个位置的距离 地理编码 反地理编码
- 百度地图学习(一):加载基本地图、本地定位、地理编码
- Demo:地图展示,定位,地理编码,标注,离线地图等
- 百度地图的使用定位,逆地理编码,自定义不同类型的大头针
- iOS开发——定位获取经纬度坐标,并反编码获得地理位置信息(具体地址,国家、省、市等)
- 定位、地理位置编码、地理位置反编码
- CoreLocation地理定位 Map Kit 地图展示
- Android地图开发中的地理编码与地理反编码
- 高德地图之地理编码