Webrider, I am adapting and playing with your excellent code for parsing kmls with very large polygons. I have a couple of questions for you:
1) I have noticed that for large polygons (i.e. ones with over 700 co-ordinate pairs) Mozilla FF cannot plot them correctly using your code. It is as if the array that holds the co-ordinates just stops filling once you get beyond 700 or so points, consequently those large polygons appear cut short on the map. This problem does not occur in IE or Chrome.
2) The great thing about your code is that the only slow part is the line "xml = GXml.parse(xmlcontent);", which can take up to 20 seconds with 8 mgb KMLs. But once this has been called once, everything else is instantaneous, so you can traverse the stored XML document and show and hide different placemarks based on attributes within a split second. However I was trying to use it with multiple KML files, one storing polygon data and one storing point data. For some reason when I call the GXml.parse method a second time on a different KML file i.e.
xml = GXml.parse(xmlcontent);
xml2 = GXml.parse(xmlcontent2);
The first xml file gets wiped out of memory, even though the second one has a different name (i.e. xml2). I get the error "xml is undefined". Any idea why this is and how to get around it? One workaround is to simply store everything one needs in a single KML file, which is the solution I am working on now. Just wondering if there was another way.....