在iOS中从经纬度获取地址 [英] Get address from latitude and longitude in ios

查看:372
本文介绍了在iOS中从经纬度获取地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为ios编程,我需要获取地址. 如何从json或其他格式的经度和纬度中获取完整地址?没有互联网就可以得到它吗? 谢谢您的关注.

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.

推荐答案

您需要的是 MKReverseGeocoder (在较旧的iOS版本上).

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

两者都使用Google Maps获取地址数据,因此您需要互联网连接才能获取数据.

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

您将获得地址为NSDictionary,但是您可以使用 JSONKit 或其他许多方式将其轻松转换为JSON字符串工具.

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

这篇关于在iOS中从经纬度获取地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆