clgeocoder *geocoder = [[clgeocoder alloc]init];
[geocoder reversegeocodelocation:manager.location completionhandler:^(nsarray *placemarks,nserror *error)
if([placemarks count]>0)
clplacemark *placemark = placemakes[0];
nsdictionary *addressdictionary = placemark.addressdictionary;
nsstring *address = [addressdictionary objectforkey:@"street"];
address = address == nil ?@"" : address
label.text = [nsstring stringwithformat :@"%@",address];}}
以上**就可是實現地理位置的反編碼了,要注意的是這邊的反編碼的測位只能是國內的,國外的話會返回乙個error,模擬器上應該將模擬定位定到hongkong
Google 地理資訊反解析
android 為位址反解析提供了標準的api 方案,但該方案並不是android sdk的一部分。手機使用者要想 正常使用該功能,手機上必須安裝 google map。但國內沒有廠家缺省內置google map,手機使用者也不可能 自動安裝。反解析的方案國內應該可以通過baidu地圖api介面,國...
ios地理編碼 反地理編碼
1.地理編碼 給定乙個名字 北京 獲得給定名字對應的位置 經緯度 2反地理編碼 給定義個位置 經緯度 獲得這個位置對應的詳細資訊 國家 省 街道 樓 import viewcontroller.h import inte ce viewcontroller end implementation vi...
iOS 地理編碼和反地理編碼
1.ui搭建,import標頭檔案 2.新增成員變數,並連線 1 ibaction geocodebutton 2 property weak,nonatomic iboutlet uitextfield inputaddress 3 property weak,nonatomic iboutlet...