I think I may know why the nodes inside the InfoWindow content is not
readily available when the InfoWindow is called to open. The DOM
nodes for the content may not even get generated while the InfoWindow
is being re-generated for another marker. This is kind of a weird
behavior since I create the InfoWindow only once and where I
setContent for it once during the initialization. Even though there
is an event handler for the InfoWindow called "domready", which should
have the content nodes already loaded within the InfoWindow, the
content of the InfoWindow may not be loaded until AFTER the InfoWindow
is loaded. The reason why I know this is because I have successfully
replaced the InfoWindow's close button ("x") on the top right corner.
If you just put the code to replace the image from the IMG element
without a setTimeout function in the DOMREADY event handler, the image
initially gets placed there and then it gets replaced by Google's "x"
image afterwards. Depending on how slow the computer is that's
rendering the Google map, the result of the setTimeout time setting
can vary from 0 ms to around 500 ms. Once you do that, you can see
the Google's "x" gets replaced by your own (depending on how fast or
slow your computer is). Anyway, I find that the InfoWindow is very
unreliable in terms of loading more complex contents and having more
dynamic functionality within it. If Google map API is supposed to
provide a richer experience for the user, maybe the Google team should
provide better event handling for the markers and InfoWindows. The
ones that are currently available are so rudimentary that you really
can't do much with them unless you want to setTimeout and clearTimeout
on everything. With slower machines, this can cause so many issues
since anonymous function calls get queued up to execute as more and
more timeouts are set to mimic event calls.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.