Get address from latitude and longitude in ios

邮差的信 提交于 2019-12-12 02:23:43

问题


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.


回答1:


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.




回答2:


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.




回答3:


You should check out Reverse GeoCoding



来源:https://stackoverflow.com/questions/10413599/get-address-from-latitude-and-longitude-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!