On May 13, 10:00 pm, Carlene <[email protected]> wrote: > I'm using Dyas' geoXML, and almost have it right how I want it. > > Right now, I'm looking to see how I would go about having a script > fire after all of the KML files are loaded. > > I am loading 3 KML files currently, and would like to load an > accordion-type script to collapse the sections of each and take up > less space. But this script needs to launch after all the markers are > loaded, otherwise it won't include all of the data.
Presumably GeoXml allows a callback function which is run once the data is loaded, and you're using that to build your sidebar. What I would do is... Write the function which collapses your sidebar. Define a global variable, say kmlProcessed; and another to indicate how many KML files you are expecting to load (numberKml, perhaps). You may already have that "total-number" variable if you're using a loop to process the KML files. At the end of each callback function, once the KML is loaded and processed, add 1 to kmlProcessed. If kmlProcessed==numberKml, then run your collapse function. That way, it doesn't matter which callback function completes first, it will be the last which makes kmlProcessed hold the right value and trigger the collapse. Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
