I have an application that was working fine until recently - see http://www.tuscanfarmholidays.com/mappage.htm [the fixed version] I had to alter the code due to the fact that a delay has been introduced in returning the DOM objects after use of openInfoWindowHtml on a GMarker. The code I am using is based on Hack #52 of Google Maps Hacks (see http://oreilly.com/catalog/9780596101619/). The principle of this hack is to load some HTML containing a DIV element with an ID of "minimap" into a GMarker tab window using the openInfoWindowHtml method. Then you can load a map into the "minimap" DIV by using document.getElementById("minimap") as the container for a GMap2 object. There is now a delay following openInfoWindowHtml before the DOM is updated with the new DIV element and so document.getElementById("minimap") returns null and my code crashed into its "catch" statement. I have fixed the code by looping around a series of try and catch statements at a 200 millisecond interval but it seems a very messy way to do this? Is there an AJAX request readystate that could be used instead? You will find the block of fixed code on lines 85 to 114 of the file agrimap.js. The bit that was added as a fix is the setInterval wrapper with a counter to stop it waiting forever. My first attempt at a fix was just to set a timer to wait for a while but I found that the time needed to ensure no crashes could be more than 5 seconds so I decided on this crash and retry approach that terminates at 10 seconds or as soon as it works. Any suggestions for a more elegant solution would be most welcome.
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
