0
我想顯示在地圖中我的應用程序,但我得到「谷歌沒有定義」得到在Apache Cordova的「谷歌沒有定義」
我index.js看起來是這樣的:
$(document).on('click', '#home_button', (function() {
var coords = new google.maps.LatLng(-17.391919993615, -66.155978093418);
var opciones = { center: coords, zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP };
var mapa = new google.maps.Map(document.getElementById("map"), opciones);
var marcador = new google.maps.Marker({
position: coords,
map: mapa,
animation: google.maps.Animation.DROP
})
getRefresh();
}));
而我的index.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 *">
<access origin="*" />
<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" href="css/jquery.mobile-1.4.5.min.css" />
<link rel="stylesheet" type="text/css" href="css/index.css">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script src="../../Jquery/prettify.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDGGvPKPbRdqHqS98CK8BShmF7VLBHepcQ&sensor=false"></script>
之後,我只是顯示它在一個<div id="map">