简体   繁体   中英

Get address from latitude and longitude in ios

I have been programming for ios and I need to get address. How can I get full address from latitude and longitude in json or other format? Can I get it without internet connection? Thank you for your attention.

What you need is the CLGeocoder (on iOS 5) and MKReverseGeocoder (on older iOS versions).

Both use Google Maps to get address data so you need an internet connection to get data.

You'll get address as NSDictionary , but you can easily convert it to a JSON string with JSONKit or many other tools.

Take a look in the Apple documentation for CLGeocoder -- specifically the reverseGeocodeLocation:completionHandler: method. It takes a CLLocation and returns reverse Geocode information you're looking for. And since this uses Google Maps, you will need an Internet connection.

您应该查看反向地理编码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM