[英]How can I search for a string of text in the native Google Maps app from PhoneGap on iOS AND Android?
I'm developing a cross-platform PhoneGap app, and I'd like a string of text in a 'Location' field, when tapped, to open up the native Google Maps app in PhoneGap or Android. 我正在开发一个跨平台的PhoneGap应用程序,我想点击“位置”字段中的一串文字,以便在PhoneGap或Android中打开原生谷歌地图应用程序。
Everyone seems to be embedding their maps directly in PhoneGap these days with the Google Maps API v3 . 现在,似乎每个人都使用Google Maps API v3将他们的地图直接嵌入到PhoneGap中。
BUT, I'd rather not, so that... 但是,我宁愿不,所以......
So far I've found: 到目前为止,我发现:
But I don't think that works in PhoneGap, aka UIWebView, so... we need this guide on integrating PhoneGap with Google Maps on the iPhone . 但我认为这不适用于PhoneGap,也就是UIWebView,所以......我们需要这本指南,将iPhone上的PhoneGap与谷歌地图集成 。 And another for Android.
另一个适用于Android。
To open native Google Maps on iPhone in PhoneGap, the command is: 要在PhoneGap中的iPhone上打开本机Google地图,命令为:
<a href="/javascript:Device.exec("openmap:q=QUERY');">QUERY</a>
I have yet to test this, and I need to find the same code for Android. 我还没有对此进行测试,我需要为Android找到相同的代码。 The final execution of this would need to open the Native Google Apps on either platform, and also on an HTML5 web version.
最终执行此操作需要在任一平台上以及HTML5 Web版本上打开Native Google Apps。
Any tips? 有小费吗?
Do Something like this for Android: 为Android执行类似的操作:
<a href="http://maps.google.com/maps?q=TD Bank Garden Boston, MA">
Android OS will ask if you want to open this with Browser or the Maps App. Android操作系统会询问您是否要使用浏览器或地图应用程序打开它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.