Much like any OS where if you click on a window then it brings that window in focus (on top). Is that also possible if you have two overlapping InfoWindow for Google Maps API v3?
I know that there is no click listener for InfoWindow class as shown in the official Google Maps API v3 reference. But there is a content_changed listener.
So currently I am thinking of a “hack” would be something like this:
- The content
divis clicked (a listener via JavaScript of jQuery) - The content
divwill be changed subtly (add an extra invisible character at the end or something) - Update the content by
InfoWindow.setContent() - The
content_changedlistener will trigger - Set a higher z-index by
InfoWindow.setZIndex()
Is there a better way to do this?
If you are going to do this… i hope you dont have to many info windows!
But would it not just be simpler to generate an array of all you info windows, then when you div is clicked move that ones z-index higher and the others all lower. Then you just need to have the object name of the info window to call myInfoWindow.setZIndex().
A little simpler.