我已经创建了 phonegap 项目并添加了一个 html 标签:
<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=Sydnew%20Opera%20House&key=MY_KEY" allowfullscreen></iframe>
当我启动 PhoneGap Desktop 时,嵌入式 Google map 在我的浏览器中成功显示。但是,当我为 Android 构建它时,Map 不显示。
在我的 config.xml
中,我添加了以下几行标记:
<access origin="*"/>
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
它已经具有互联网权限。为什么会这样?
更新
我在我的 config.xml
中添加了这行代码:
<allow-navigation href="https://www.google.com/maps/embed/*" />
仍然没有显示。
最佳答案
我已经解决了这个问题。
当我将此插件添加到我的 confix.xml
文件时,所有 access
标签开始工作:
<plugin name="com.indigoway.cordova.whitelist.whitelistplugin" source="pgb" />
然后我将我的项目上传到 PhoneGap Build 网站并下载了应用程序。
关于android - PhoneGap,嵌入式谷歌地图未在 Android Build 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40191282/