标记谷歌地图有时不显示

时间:2014-04-17 07:39:21

标签: jquery

   var marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                draggable:true
            });

        marker.setIcon(/** @type {google.maps.Icon} */({
            url: place.icon,
            size: new google.maps.Size(71, 71),
            origin: new google.maps.Point(0, 0),
            anchor: new google.maps.Point(17, 34),
            scaledSize: new google.maps.Size(35, 35)
        }));

        marker.setPosition(place.geometry.location);
        marker.setVisible(true);

1 个答案:

答案 0 :(得分:0)

尝试在loadSpots()结束时调用initializeMaps(),否则可能会在map初始化之前访问{{1}}。