After some testing, it does appear that the webkit browsers (Chrome,
Safari) cache the response from calls to google.maps.KmlLayer (Firefox
appears not to), and will not go back to Google if you issue an
identical call to google.maps.KmlLayer. If you manually clear the
cache and make an identical KmlLayer request, Chrome/Safari will
actually send that request to Google.
This behavior is desirable if your KmlLayer request to Google was
successful (meaning you got the metadata_changed event and tiles were
returned to your browser). However, if Google was NOT able to process
your KmlLayer request within 4 seconds (not able to upload and render
your KML file due to size and complexity or your KML file and/or speed
of response of your server ... not due to the limits like overall size
of the KML file), then there's no way to issue that request again to
Google because the webkit browser will always go to the cache ... and
what's there is what appears to be nothing other than a dead-end call
to some callback function.
This dead-end cache response is unfortunate, because multiple
identical calls to KmlLayer WILL eventually return the
metadata_changed event and display the tiles. Google either continues
to work on your original request in the background, or repeated
requests to KmlLayer with the same URL will build parts of the map
tiles until they're all complete, at which point you get the
metadata_changed event.
Sure wish I could either:
1) Have Google send a status code other than "200 OK" when they can't
render your KML file within 4 seconds (like maybe code "202
Accepted"). Then perhaps when you issue the KmlLayer request again
using the same KML URL, then the browser will go back to Google rather
than the dead-end content in the cache.
2) Figure out how to have Chrome/Safari ignore the cache content. Thus
far I don't know of any way to do this.
Well, hope this "bump" inspires some thought out there. I realize that
my other option is to split my content up into pieces (not so easy
since in our production environment we're providing the KML data
dynamically). Perhaps I need to make a feature request to Google for
(1) above.
Tim
On Sep 9, 11:14 am, tallt <
tim.haverl...@gmail.com> wrote:
> Guess I should clarify what I'm asking:
>
> 1) Does anyone know why this does not work in Chrome (my biggest
> concern)?
> 2) Anybody know a better way of waiting for a KML to be rendered ...
> it's obvious after the initial call to kmllayer that Google is still
> working on rendering my KML. Is there any way to keep my initial call
> to kmllayer from timing out?
>