iPhone谷歌地图获取地址的纬度和经度

发布于 2024-09-01 02:13:21 字数 70 浏览 2 评论 0原文

谷歌地图上是否有任何网址可以返回地址的纬度和经度。 我想使用 iPhone 地图套件中的这些纬度和经度详细信息来绘制一些信息。

Is there any URL from google maps, that returns me the latitude and longitude of an address.
i want to use these lat and long details in iPhone Map kit to plot some information.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哽咽笑 2024-09-08 02:13:21

这对我有用:

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
                      [addressField.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];

祝你好运

This is working for me:

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
                      [addressField.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];

good luck

_畞蕅 2024-09-08 02:13:21

我不认为有内置的方法可以进行反向地理编码,但我对 iPhone、Objective C、Cocoa 和 XCode 还很陌生,所以。

这是我能找到的最好的文章主题。

放入我的“could be good”书签抽屉中:)

第二个示例 URL 提供了一个 XML 文件,您可以使用 initWithContentsOfURL 获取该文件,然后使用 getObjectForKey:@"lat"getObjectForKey:@"lng" 或类似的内容。

I don't think there's a built in way to do reverse reverse geocoding, but I'm new to the iPhone, Objective C, Cocoa and XCode, so.

This is the best article I could find on the subject.

Goes in my 'could be good' bookmark drawer :)

The second example URL gives an XML file that you could fetch with initWithContentsOfURL, and then getObjectForKey:@"lat" and getObjectForKey:@"lng" or something along those lines.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文