【发布时间】:2016-02-16 07:21:43
【问题描述】:
应用在低版本安卓手机上运行良好(在 jellybean 上测试)。它在低版本 (4.1.2) 安卓手机上显示谷歌地图。
我调用 Google 地图 API 的脚本是
<script src="https://maps.googleapis.com/maps/api/js?key=xxxxx"> </script>
在 config.xml 中
授予的权限列表
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
在AndroidManifest.xml manifest下
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<application android:hardwareAccelerated="true" android:icon="@drawable/logo" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />
index.js
map = new google.maps.Map(document.getElementById("mapmake"), myOptions);
HTML 元标记
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
那么为什么它不能在最新的 Android Phone(5.1.1) 上显示 BLANK div?
【问题讨论】:
-
您可以尝试使用没有api密钥的googlemap api v3并检查它是否工作。
-
它不适用于此 Google 地图 API URL
-
-
我也在最新版本中收到“google is undefined”错误。
-
一件事而不是 https 使用 http... 如果不起作用,请查看 stackoverflow.com/questions/20386782/…
标签: android cordova google-maps