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:
div
is clicked (a listener via JavaScript of jQuery) div
will be changed subtly (add an extra invisible character at the end or something) InfoWindow.setContent()
content_changed
listener will trigger 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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.