Ionic Google Maps在Android设备中不起作用,但在浏览器中工作正常

时间:2016-06-02 05:41:22

标签: android angularjs google-maps ionic-framework

我已在我的应用中集成了谷歌地图,这在浏览器中运行良好。

我还安装了 cordova白名单插件并添加了元标记:

<meta http-equiv="Content-Security-Policy" content="default-src *; 

script-src 'self' 'unsafe-inline' 'unsafe-eval' *; 

style-src  'self' 'unsafe-inline' *">

但似乎没有任何效果。

请告诉我还有什么办法可以让地图在Android设备上运行。

1 个答案:

答案 0 :(得分:1)

我通过将https://添加到Google API网址即

来解决了这个问题

 <script src="//maps.googleapis.com/maps/api/js?key=[my key]"></script> 

 <script src="https://maps.googleapis.com/maps/api/js?key=[my key]"></script>