0
只是我想要一个谷歌地图工作科尔多瓦安卓的最小例子。 该代码在Chrome和Firefox的本地主机上正常工作,但我无法在设备上工作。科尔多瓦3.3安卓和谷歌地图,铬错误
示例代码:
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
<script type='text/javascript'>
window.addEventListener('deviceready',function(){
var latitud = xx.xxxxxxx;
var longitud = x.xxxxxxxxxxxxxxxx;
success(latitud,longitud);
},true);
function success(latitud,longitud) {
var coords = new google.maps.LatLng(latitud, longitud);
var options = {
zoom: 15,
center: coords,
mapTypeControl: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("prova_maps"), options);
var marker = new google.maps.Marker({
position: coords,
map: map,
title:"You are here!"
});
}
</script>
</head>
<body>
<h1>Google Maps</h1>
<div id='prova_maps' style='height:250px;width:250px;'></div>
</body>
</html>
我在控制台以下错误直接与这一问题重新启动,但无法找到一个解决方案:
https://imageshack.com/i/f3myppp
我有在config.xml中添加访问标签。
现在随着cordova js标签最后工作的感谢之人!!!! – Xdevelop
像在登录猫,你正在得到什么是恐怖.. –
这是否解决了你的问题.... –