Hi Everyone,
I am trying to display a frequently changing network topology via
google earth.
The network topology consists of nodes and links between them. The
topology is
quite dynamic as nodes move and links make and break. The network is
not so
dispersed and fits easily within a couple of city blocks.
I want to be able to display this 'dynamic network' on google earth,
with nodes
represented as points and links as lines. And I also want the user to
be able
to click on a node (in google earth) and bring up a context sensitive
popup 'Node
menu', and similarly when clicking the links.
The way I am doing it now is pretty standard: I have a backend
database which
is updated as the topology changes. And a frontend Cgi script which
reads this
DB and dishes out the KML representation of this graph. And finally I
have a
network link which periodically polls (pulls) this cgi script. The
polling
frequency has to be fast as the network is quite dynamic. I currently
set it to
poll every second.
In the KML that I dish out, nodes are represented by placemarks, and
links by
placemarks and linestrings. The context sensitive popup menu is
encoded in the form
of the html-description of the nodes and links.
The problem I am having with this setup is that it ends up repainting
the
entire scene each time (ie every second) it fetches the network link.
So when a
user clicks on a node to bring up its popup html description, that
description
is lost as soon as a new update happens.
Also because of the periodic polling, the whole thing is a bit jerky
as it
seems more like a fast slide show rather than a smooth animation.
So my questions are:
i. Are there any suggestions on whether I should be using a different
architecture to display something dynamic. Is there any way to 'Push'
updates
to google earth, instead of polling them.
ii. How do I make it not repaint the entire screen, or how do I ask it
retain
the popped up 'Node description' instead of erasing it each time it
updates it.
I am using the following version of google earth.
4.3.7204.0836 (beta)
Apr 24 2008
13:27:36
OpenGL
Linux (2.6.24.0)
Ubuntu 8.04
And this is the network link that I use:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="
http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Blah Blah</name>
<open>1</open>
<flyToView>1</flyToView>
<refreshVisibility>1</refreshVisibility>
<Link>
<refreshMode>onInterval</refreshMode>
<refreshInterval>1</refreshInterval>
<href>
http://localhost/cgi-bin/graph.kml.rb</href>
</Link>
</NetworkLink>
</kml>
Thanks. All pointers/suggestions are quite welcome. Please let me know
if more information is required.