Closed GoogleCodeExporter closed 9 years ago
You could write a closeclick handler that is called when the InfoBox is closed.
That would allow you to keep track of the show/hide status of the InfoBox.
The getMap() technique you mention is the one to use to determine if the
InfoBox is currently added to a map -- if it returns null, the InfoBox won't be
visible. Same for a google.maps.InfoWindow.
Original comment by garylitt...@gmail.com
on 8 Jul 2011 at 4:38
[deleted comment]
google.maps.event.addListener(marker, 'click', function() {
var isOpen = ib.getMap();
if (isOpen === null){
ib.open(map, this);
} else {
ib.close(map, this);
}
});
Original comment by lewismca...@gmail.com
on 8 Nov 2011 at 2:40
This is just what I was looking for except for one problem. My marker click
wasn't opening my InfoBox on the first click until I changed:
if (isOpen === null)
to
if (isOpen == null)
One less equal sign in the operator.
Original comment by Trevor.Vigoren
on 14 Oct 2012 at 9:54
Original issue reported on code.google.com by
iruben...@gmail.com
on 18 May 2011 at 7:10