I have a KMZ file for GE plugin. This file have lots of PNG into, and several kml (poligons, lines, placemarks, etc).
The function to run this tour is:
function loadKmztour(href){
google.earth.fetchKml(ge, kmlURL, function(kmlObject) {
if (kmlObject){
ge.getFeatures().appendChild(kmlObject);
walkKmlDom(kmlObject, function(context) {
if (this.getType() == 'KmlTour') {
ge.getTourPlayer().setTour(this);
ge.getTourPlayer().play();
}
});
});
}
It runs well, but only the second time when I run the tour. When I run it for first time, it run only the tours but doesn't show the poligons, placemarks and png, but if I click the tour for second time, it work fine.
How can I force the kmz info to load at first time?
Thank you for any help. Best Regards, Shunsho.
UPDATE: Sometimes, the kmz poligons and placemarks load at the first time...but it work only sometimes...I think that maybe the tour started to run before the kmz is appended, so the problem is how I can force to wait the appendChild and then run the tour...Thanks!