0
こんにちは私はコードドットとGoogleマップで新しいです、私はコードバプロジェクトで簡単なGoogleマップを構築しています。私のコードはブラウザで正常に動作していますが、apkに組み込まれてデバイスにインストールされている場合、Googleマップは表示されません。Googleマップはコードアンドロイドでは表示されませんが、ブラウザに表示されます
index.htmlを
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data gap https://*.google.com https://*.googleapis.com https://*.gstatic.com https://*.googleusercontent.com 'unsafe-inline' 'unsafe-eval'; 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">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>Hello World</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map">Maps</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxx&callback=initMap"
async defer></script>
</body>
index.js
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
問題は何ですか?
あなたは[PhoneGap plugin](http://docs.phonegap.com/en/4.0.0/guide_hybrid_plugins_index.md.html)も使用していますか? はいの場合は、関連する[SO post](http://stackoverflow.com/questions/17423558/phonegap-google-maps-api-v3-not-displaying-at-all-on-android)で提案されている解決策をお試しください。 )また、この[GitHub投稿](https://github.com/mapsplugin/cordova-plugin-googlemaps)を確認してください。それが役に立てば幸い! – Teyam