本文介绍了将Google Maps API集成到iPhone应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 更新:iPhone SDk 3.0现在解决了这个问题,但是NDA阻止了任何深入的讨论。如果您需要更多信息,请登录iPhone开发中心。 好吧,我不得不承认我在这里有点迷路。 我对Cocoa很满意,但是在解决这个问题时遇到了一些JavaScript问题。 我试图发送向Google申请反向地理代码。 我查看了我在此处查看的Google文档: http://code.google.com/apis/maps/documentation/index.html http://code.google.com/apis/maps/documentation/geocoding/ 即使经过粗略的阅读,我仍然缺少一个基本的概念: 我如何与谷歌交谈?在一些例子中,他们显示一个url被发送到谷歌(这似乎很容易),但在其他人显示的JavaScript。对于反向地​​理编码来说,请求可能比发送带有一些参数的url更难(但我希望我错了)。 有人可以指出我是否正确提出请求的方式? (在Objective-C中,所以我可以将它包裹起来)解决方案更新 - iPhone 0.3包含MapKit,希望比使用JS API快得多。 blurb表示它将包含反向地理编码。 您无法直接在objective-C中发出请求,至少不会在Google API的条款中提出请求。 Google API是用Javascript编写的。您可以使用Objective-C JS桥梁,如 Google地图组件,但这并不能真正解决问题 - 你仍然在进行JS调用! 不幸的是,这意味着你a)需要使用webview b)需要使用速度慢的JS API ...与使用完全不同的OTA协议的Google Maps应用程序进行比较(尝试数据包嗅探它)。 然而,Google地图组件是如何简单调用API的有用教程。 Update: iPhone SDk 3.0 now addresses the question here, however the NDA prevents any in depth discussion. Log in to the iPhone Dev Center if you need more info.Ok, I have to admit I'm a little lost here.I am fairly comfortable with Cocoa, but am having trouble picking up the bit of javascript needed to solve this problem.I am trying to send a request to Google for a reverse geo code.I have looked over the Google documentation I have viewed here:http://code.google.com/apis/maps/documentation/index.htmlhttp://code.google.com/apis/maps/documentation/geocoding/Even after a rough reading, I am missing a basic concept:How do I talk to google? In some examples, they show a url being sent to google (which seems easy enough), but in others they show javascript. It seems for reverse geocoding, the request might be be harder than sending the url with some parameters (but I hope I am wrong).Can someone point me to the correct way to make a request? (In objective-C, so I can wrap my head around it) 解决方案 UPDATE - iPhone 0.3 includes MapKit, which will hopefully be significantly faster than using the JS API. The blurb says that it will include reverse geocoding.You can't make a request directly in objective-C, at least not within the terms of the Google API. The Google API is written in Javascript. You could use an objective-c to JS bridge, as the Google Maps Component does, but that doesn't really solve the issue - you're still making JS calls!Unfortunately, that means youa) need to use a webviewb) need to use the JS API which is slow... compare with the Google Maps application which uses a completely different OTA protocol (try packet sniffing it).The Google Maps Component is, however, a useful tutorial in how to make simple calls to the API. 这篇关于将Google Maps API集成到iPhone应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-19 00:47