1
我正在使用Visual Studio 2013 Apache Cordova應用程序。我在Google地圖上找到一個點時遇到問題。我在我的應用中添加了地理位置插件,但它不起作用。這裏是我的代碼:GoogleMaps不會在我的科爾多瓦應用程序中運行
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div><button id="showmap" >show map </button></div>
<div id="googleMap">View Map ---</div>
<script src="cordova.js"></script>
<script src="scripts/platformOverrides.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script>
$("#showmap").click(function() {
var damas = new google.maps.LatLng(33.513, 36.2920000000003);
var mapProp = {
center: damas,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var myCity = new google.maps.Circle({
center: damas,
radius: 20000,
strokeColor: "#0F00FF",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#F0F0FF",
fillOpacity: 0.8,
editable: true
});
myCity.setMap(map);
});
</script>
</body>
</html>
請給我一些建議。謝謝!
你有沒有試圖爲你的'googleMap' div設置一個維度? – erikscandola