在几个页面上,我开始收到上述错误,但仅在 Chrome 中......
这是一些简单的代码来演示该错误:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyD4uPYa8gidHCvCzXxEAalEzkEh94MhZYg&sensor=false"></script>
<script>function initializeMap() {
myLatlng = new google.maps.LatLng(42.791968,3.035231);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Tonys Place - Luxury apartment near the beach'
});
}
google.maps.event.addDomListener(window, 'load', initializeMap);
</script>
</head>
<body>
<div id="map_canvas" style="width: 400px; height: 400px">
</div>
</body>
</html>
我很困惑 - 任何想法表示赞赏!
Thanks
我想这和我最近遇到的问题是一样的。我通过在标记上添加“optimized: false”作为选项来解决这个问题。
marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Tonys Place - Luxury apartment near the beach',
optimized: false
});
标记选项
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)