Dectect internet connection missing?

13 views
Skip to first unread message

JackP

unread,
Dec 16, 2009, 12:10:30 PM12/16/09
to KML Developer Support - Google Earth Plug-in
Hello,
I have created a webpage containing a JS with Google Earth Plugin. My
page automatically updates itself every minutes. I would like to find
a way to check if there is an internet connection otherwise the update
crashes the application!
Is there a way to do it? I have tried with the function "failureCB" as
parameter for the

function init() {
google.earth.createInstance("map3d", initCallback,
failureCallback);

}

but it's not recalled when internet connection is not available.
Furthermore I also need to know if the connection drops-down even
after the initial-phas.
Any help?

Kyle

unread,
Dec 17, 2009, 5:54:21 PM12/17/09
to KML Developer Support - Google Earth Plug-in
You'll need to use some of the more advanced features for loading the
plugin and accessing your data. In my application, I use fetchKML to
load the content. Since this occurs asynchronously it doesn't crash
the app if it fails. If the request fails it just doesn't get new
data. So, if you're loading new data "in the background" this should
work just fine.

You can read up on using fetchKML with examples here:
http://code.google.com/apis/earth/documentation/kml.html#fetchkml_and_parsekml

JackP

unread,
Jan 15, 2010, 5:53:35 AM1/15/10
to KML Developer Support - Google Earth Plug-in
Hey Kyle,
I've seen the link you posted but sincerly I cannot get how to use the
fetchKML in my case where what I have to load is simply the Google
Earth Plugin and a layer of KML photos took from Panoramio. Do you
mean that the problem of connection missing is just due to the KML
photos and not to the Google Earth Plaugin loading?? If so, the
problem get easier and I'll just go throwout your solution.
Please, let me know.
Best Regards
Giacomo


On Dec 17 2009, 11:54 pm, Kyle wrote:
> You'll need to use some of the more advanced features for loading the
> plugin and accessing your data.  In my application, I use fetchKML to
> load the content.  Since this occurs asynchronously it doesn't crash
> the app if it fails.  If the request fails it just doesn't get new
> data.  So, if you're loading new data "in the background" this should
> work just fine.
>
> You can read up on using fetchKML with examples here:http://code.google.com/apis/earth/documentation/kml.html#fetchkml_and...

Kyle

unread,
Jan 27, 2010, 2:53:38 PM1/27/10
to KML Developer Support - Google Earth Plug-in
I'm not 100% sure, but I believe the Plugin itself fails gracefully if
it loses its connection to the Google Earth servers. Meaning, it just
doesn't download new image data when you zoom in to a location or
whatever. So you shouldn't have to worry about the plugin itself
losing connection. If you're crashing when you try to fetch new KML,
using the fetchKML function should prevent the crashes.

If, when you say "the page automatically updates" you mean the entire
page (such that the google earth plugin is reloaded), then you really
just want to change it to send out a new fetchKML call every few
minutes, rather than refreshing the entire page. (Assuming there
aren't other elements on the page you're trying to refresh as well).
Reply all
Reply to author
Forward
0 new messages