On 2 August 2010 13:38, [email protected]
<[email protected]> wrote:
>
> Isn't there a way, to check if a infowindow is open on the map and
> than call closeWindow() ?
There is only ever one infoWindow on a Version 2 map, so you check
whether it's open with something like the following (assuming your map
is called "map"). If the infoWindow is not hidden, close it:
if (!map.getInfoWindow().isHidden()) { map.closeInfoWindow() }
However, map.closeInfoWindow() on its own won't cause an error if the
infoWindow is already closed, so you can't do any harm using that
without testing for whether it's open.
Because there is only one infoWindow, there isn't really a great deal
of point in assigning it to a variable, which is why openInfoWindow()
doesn't return a reference to it.
It's different in Version 3 where you can have many infoWindows open at once.
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.