NetworkLink fails to refresh map

90 views
Skip to first unread message

carson...@gmail.com

unread,
Sep 30, 2009, 10:00:19 PM9/30/09
to KML Developer Support - Google Earth Plug-in
I have a .kml file (buffer.kml) that is constantly being rewritten by
a server process every 40 seconds with new information.
I have established a networkLink to this .kml inside a function
called
kmlLOADPoint() which I call in the initCB() function.
The map will load the .kml initially and will continue to update when
the .kml file updates but only a handful of times. Eventually it
stops
reflecting the changes in the .kml file. Even when I go in and change
values around in the .kml file the map does not reflect the changes.
This has only started happening after the recent update on sept 9th:
http://groups.google.com/group/google-earth-api-notify/browse_thread/...
Here is my code:
<script type="text/javascript">
var ge;
google.load("earth", "1");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
kmlLOADPoint();
}
function failureCB(errorCode) {
}
google.setOnLoadCallback(init);
function kmlLOADPoint() {
nl = null;
nl = ge.createNetworkLink("");
nl.setFlyToView(false);
var link = ge.createLink("");
link.setHref("http://65.68.82.97/users/<%= user.identity.name %>/
buffer.kml?nocacher=" + (new Date()).getUTCSeconds());
link.setRefreshMode(1);
link.setRefreshInterval(5);
nl.setLink(link);
ge.getGlobe().getFeatures().appendChild(nl);
}

</script>

I have found other's also complaining of the same anomaly:
http://groups.google.com/group/kml-support-getting-started/browse_thread/thread/7eed44d377a294e0/34dd565881778c61?q=%22NetworkLink+fails%22+OR+%22fails+to%22+OR+%22to+refresh%22+OR+%22refresh+map%22&lnk=sbp#34dd565881778c6

Upon testing, I have noticed that the problem doesn't occur on
smaller .kml files. The buffer.kml file size can range between 500kb
to 2mb, is this too big for a .kml to be in order for it to refresh
reliably? Has anyone else experienced issues since the update along
these lines? I would be EXTREMELY appreciative of any support or
suggestions.

I have also noticed that google chrome seems to be immune from this
bug.


[if this post seems familiar, I posted it before and took it down
because I thought I had correct the problem only to find out that I
was wrong.]

Roman N

unread,
Oct 2, 2009, 5:12:55 PM10/2/09
to KML Developer Support - Google Earth Plug-in
Hi,

Have you been able to reproduce the bug since our bugfix release
version 5.1.3509.4636? The large-file-fail bug should've been fixed in
that version.

Thanks,
Roman
> I have found other's also complaining of the same anomaly:http://groups.google.com/group/kml-support-getting-started/browse_thr...

carson...@gmail.com

unread,
Oct 5, 2009, 4:12:00 PM10/5/09
to KML Developer Support - Google Earth Plug-in
Yes, this is occurring at this very moment, in fact.

I think I've discovered the bug.
The process I created to dynamically create a .kml file from SQL data
creates anywhere between 1 and 1000 Placemarks in the .KML file.
This .KML file is referred to on the webpage hosting the API through
the networkLink (we are tracking the movement of vessels up and down
the port of Houston, Texas). When I constrain the number of placemarks
to under 100, the process begins to refresh flawlessly; The bug only
occurs when more Placemarks are added into the .KML file.

Keep in mind I've worked almost non-stop on this bug since it was
first reported by my clients who use this website (the day of the most
recent API release). I feel very strongly that this is a bug. The fact
that my website has worked for almost two years prior to the most
recent release of the API adds to that hypothesis. I want to provide
you with a URL that proves this, but that would be rather difficult to
do, seeing how it is based off of dynamically generated information.
Are you going to be able to confirm these claims yourself? If not,
please reply and allow me to assist in someway, at the moment I have a
lot of very angry clients and I would appreciate any assistance!

PS> I have also put the my code into the google-code-playground and
the same symptoms occur.

carson...@gmail.com

unread,
Oct 5, 2009, 5:51:09 PM10/5/09
to KML Developer Support - Google Earth Plug-in
Update:

I've discovered that even when the .kml file is reduced in size it
will still eventually fail, but the time it takes to fail is MUCH
longer. Where I was getting between 3-10 correct refreshes I now can
get 30-40+. Lowering the size of the file seems delay the defect from
occurring but it does not cure it.

Roman N

unread,
Oct 9, 2009, 5:48:15 PM10/9/09
to KML Developer Support - Google Earth Plug-in
Perhaps this is due to a race condition on the server (i.e. writing to
the file and a client is fetching simultaneously)? I'd set up Fiddler
or some other network traffic watcher and look for HTTP errors. IIRC,
if GE observes an error while fetching a refreshing network link, it
stops refreshing.

carson...@gmail.com

unread,
Oct 9, 2009, 7:23:52 PM10/9/09
to KML Developer Support - Google Earth Plug-in
Roman:

Is there an event handler to detect when GoogleEarth disables a
networkLink? At the moment, it will simply stop working without
warning. If not, is there any diagnostics functionality held within
networkLink? Perhaps a way to create a callback for each networkLink
refresh event?

Roman N

unread,
Oct 12, 2009, 12:47:50 PM10/12/09
to KML Developer Support - Google Earth Plug-in
There's no event handler for that at this time; there are two similar
feature requests though:

http://code.google.com/p/earth-api-samples/issues/detail?id=37
http://code.google.com/p/earth-api-samples/issues/detail?id=5

Feel free to vote (by starring) or comment on those feature requests
or file a new one if you'd like something different.

Thanks,
Roman

Isa

unread,
Oct 13, 2009, 3:30:36 AM10/13/09
to KML Developer Support - Google Earth Plug-in
Hi I'm facing the same issue with a very small kml file (2kB) and GE
5.0.11733.9347
I'm updating the kml file with an application written in C# but often
I can see GE pausing network link refresh.
Is there any workaround to this known issue? Is this due to race
conditions on the file?

Thanks in advance.
> > > > > was wrong.]- Nascondi testo citato
>
> - Mostra testo citato -

carson...@gmail.com

unread,
Oct 13, 2009, 3:46:07 PM10/13/09
to KML Developer Support - Google Earth Plug-in
Roman / Isa:

The KML that I am referencing is rewritten with new information every
10-40 seconds, so there are no doubt instances where the networkLink
is refreshing while the server is re-writing the KML.
This should not affect the GoogleEarth at all though, would it?
Reading can occur simeltaneously but writing cannot. Has the newest
update created a sensitivity to reading a KML while it is being re-
writen?
> > - Mostra testo citato -- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages