简体   繁体   English

如何在iOS和Android上的PhoneGap中搜索原生Google Maps应用中的一串文字?

[英]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... 但是,我宁愿不,所以......

  1. my user's get 'turn-by-turn-directions' of the native Maps app, and to, 我的用户获得原生地图应用的“转弯方向”,并且,
  2. prevent PhoneGap's performance issues with Geolocation enabled . 在启用Geolocation时阻止PhoneGap的性能问题

So far I've found: 到目前为止,我发现:

  1. this guide to open native Google Maps in iOS in Mobile Safari, and in the native browser on other platforms . 本指南可在Mobile Safari中的iOS中以及其他平台上的本机浏览器中打开本机Google地图
  2. this guide to invoke Google Applications on Android Devices . 本指南在Android设备上调用Google应用程序 (This is native, not HTML5 in PhoneGap.) (这是本机的,而不是PhoneGap中的HTML5。)

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.

相关问题 Android Phonegap - 如何打开本地谷歌地图应用程序 - Android Phonegap - How to Open Native Google Maps Application 如何在Ionic Application中使用原生iOS / Android地图? - How can I use native iOS/Android maps in Ionic Application? 启动Google Maps Native Application Android Phonegap - Launch Google Maps Native Application Android phonegap 如何在Phonegap / Cordova(iOS和Android)中的Google地图中获取后退按钮 - How to get a back button in google maps in Phonegap/Cordova (iOS & Android) Google Maps将不会加载到我的PhoneGap Android应用中 - Google Maps Will Not Load In My PhoneGap Android App 我可以在PhoneGap中为本地Android和iOS应用程序使用Perl脚本吗? - Can I use Perl script in PhoneGap for native Android and iOS apps? 如何绘制从我的android应用发送到tomcat服务器的经度和纬度,并在该处的Google地图上进行绘制? - How can i plot the longitudes and latitudes sent from my android app to tomcat server and plot on the google maps there? 我如何绘制从我的 android 应用程序发送到 tomcat 服务器的 lat ,lng 并在那里的谷歌地图上绘制? - How can i plot the lat ,lng sent from my android app to tomcat server and plot on the google maps there? 如何在谷歌地图上搜索POI? - How can I search the POI on google maps? 带有iOS和Android的Phonegap地图 - Phonegap Maps with iOS and Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM