I have a Google Map that is created using the newer Google Maps API V3 from a Perl script. The script builds the map from values passed to it from hidden form fields in the parent page, and returns the map into an iframe in the same parent page.
The reason that the map is in the iframe, is because I have discovered browser issues both with Firefox and IE when trying to render the map directly to a div on the parent page. This does not occur when the map is elsewise rendered into the iframe window. I have concluded that this is because the new Google Maps API V3 is a bit querky in how it interprets CSS inheiritence, and more or less demands that the map be rendered to a block element with 100% values for both width and height. By rendering the iframe window into the div, I can control the size I want through the div's CSS, while at the same time giving the Google Maps API the 100% width and height values through the iframe document.
This came about originally, because I really wanted the map to be rendered in a hidden div, that is made visible with jQuery when a user clicks on the Map link. However, this will not work in either Firefox or IE, and the map fails to render in an element whose initial CSS display property is set to none. This will not even work when trying it with an outer div wrapper where it should have inheirited the values from that wrapper div.
So now I have a workaround, where the div is not initially hidden, the iframe shows, the maps builds perfectly, and then a setTimeout event written into the iframe page then closes the div to hide the map on the parent page. I know, I know, it's quite the hack, but it does allow the map to render properly and then hides it from view.
So what I am looking for here, is a way to tell when the map has finished rendering to initiate the jQuery event to hide the div, instead of the setTimeout method that is currently being used (which is also no guarentee that the map really has finished rendering. It's only a good timed guess at best).
Below is an example page where you can observe this entire sequence of how the map is built and then hides.
http://www.cooscurryclassifieds.com/adpages/20100910-041923.html
I have searched through the Google Maps API V3 documentation, and looked around elsewhere on the web to see if there was some way to tell when the map has completed rendering without success, and am hoping someone familiar with the new Google Maps API might have the answer I seek to at least make this workaround hack a bit more graceful :)
Thanks for any direction you can point me to achieve what I'm trying to accomplish here.