Hi,
I want to reload a kml file every few seconds with the latest
generated version, this is working fine using setInterval to call the
function below. The function is removing the previous kml then loading
it again, the refresh variable is just to force the page to download
the file again...
function refreshkml ( )
{
kmlLayer.setMap(null);
kmlLayer = new google.maps.KmlLayer('db_output_xml.php?refresh='+
(new Date()).getMilliseconds());
kmlLayer.setMap(map);
}
If the above doesn't format right:
http://www.pastie.org/1637107
I know I should share the url but i'm still butchering the code so
it's a bit of a mess.
The problem is, there is a significant delay (few seconds) between the
kml being turned off and the new one loading, during which time there
is no overlay showing. I was thinking of having a second copy of the
kml generating file, toggling between which one is loaded... and
removing the previous one AFTER the new one has fully loaded.
Is there any way to trigger a function when a setMap(map) has fully
loaded to the map?
Thanks for any help or suggested workarounds! ;-)
Joe