2

在几页上,我已经开始收到上述错误,但仅限于 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>

我很难过 - 任何想法表示赞赏!

谢谢

4

1 回答 1

11

我认为这与我最近遇到的问题相同。我通过在我的标记上添加“优化:假”作为选项来解决它。

marker = new google.maps.Marker({
    position: myLatlng, 
    map: map,
    title: 'Tonys Place - Luxury apartment near the beach',
    optimized: false
});   

标记选项

于 2013-06-26T15:51:52.807 回答