On this page, I show a Google map with InfoBubbles that appear over the map markers. The InfoBubbles are open initially. If you close them, you can re-open them by clicking on the marker. I would like the InfoBubbles to be closed initially. The relevant function (simplified to remove irrelevant stuff) is:
addMarker = function(festivalData, hasPopup) {
var map = this._map;
this.marker = new google.maps.Marker({
position: new google.maps.LatLng(festivalData.latitude, festivalData.longitude),
map: map
});
if (hasPopup) {
var infoBubble = new InfoBubble({
map: map,
content: "<a href= " + festivalData.url + " >" + festivalData.name + "</a>",
hideCloseButton: false,
});
infoBubble.open(map, this.marker);
var infoBubbleHandler = function(bubble) {
return function() {
if (!bubble.isOpen()) {
bubble.open(map, this.marker);
}
}
}(infoBubble);
google.maps.event.addListener(this.marker, click , infoBubbleHandler);
}
}
我期望通过删除这一行文。
infoBubble.open(map, this.marker);
这将实现我的目标,但这只是彻底清除了InfoBubbles,以便他们甚至在你点击标识时不露面。 如何使InfoBubbles在一开始就关闭了,但在你点上标点时却开放了吗?