As described in the back story, the seed of the idea was the example of using a NetworkLink to have a cgi script create a Google Earth placemark at the center of your current view.
The URL in every NetworkLink receives by default the bounding box of your current view in Google Earth when the NetworkLink is refreshed. You can change the details of what gets sent back to the URL, turning off the view information, or adding some more details that Google Earth lets you, or adding a bunch of things you've made up yourself. You are creating a query string for the URL in web server terms.
Follow the leader is a cgi script, written in Perl. It reads the query string that a leader's Google Earth sent to it and creates a placemark of that view, storing it in a temporary file on the web server. To permit more than one leader at the same time, the file with the leader's placemark is named after the leader's IP address by default.
It also, with other options, looks at all the temporary files and creates a KML folder with a list of the addresses of people who have recently sent their views. This list is sent back to the Google Earth of people who want to follow a leader.
Each leader's entry in that list is also a NetworkLink to this same script. When a leader's entry is selected, the script will now send that leader's placemark, forcing the follower's Google Earth to fly to that leader's view.
The controls are the KML links inside Google Earth. The leader's control is configured to refresh the NetworkLink 2 seconds after stopping. This gives the leader some time to move around and get his view the way he likes it before it gets sent on to the cgi script.
The follower's control is a NetworkLink to download the list of current leaders. When the list is downloaded, each leader's entry is a NetworkLink which gets automatically refreshed every 3 seconds. After the leader has sent a new view, the follower gets taken to that view at the next refresh.
It was surprisingly easy to cobble up the original version. I emailed the first version of the KML side of things to my Dad within two hours of the light bulb turning on.
Since then, Follow the leader has undergone a series of changes in the back end, but the front end has never budged. I've made many things about the process easier, but what it does and how it looks is still pretty much the way it was when I wrote up the instructions learned from that first test session with my Dad.
Download Follow the leader
Vealé Home | Last modified on Sat Apr 25 11:50:04 2009 | Contact: Vealé |