Making the Jane Goodall Institute's "Chimp Blog" more accessible

I liked the website-style navigation approach on the Jane Goodall Institute's (JGI) Chimp Blog. Navigation and feature-control from right inside the placemark descriptions is a key concept to improving Google Earth's usability with complex data layers.

Unfortunately, once you have clicked on one of the layers in the balloon's left-hand table/menu, you can't turn it back off with the same link. And, if you click the same link again, GE asks you if you want to reload the file.

This is confusing and distracting for users. Knowing there was a better way, I developed a technique to add mock checkboxes to the "Chimp Bios" placemarks. These allow you to turn on and off the related layers without ever touching the "My Places" sidebar.

As I suggested some time back, I think that Google Earth needs an internal URI to allow links in placemark descriptions to manipulate related layers and features. Such functionality would allow for the customization of layer navigation, and greatly improve usability for complex KML.

After the release of KML 2.1, it occurred to that using custom <Schemas>, <BalloonStyle> + <text> and <NetworkLinkControls>, simple URI functionality could be emulated.

 

My Solution:

The "Chimp Bios" () ballon descriptions have a mock checkbox next to each feature item. By clicking on the checkbox, or the feature's text link, you can turn on and off that feature without interacting with the "My Places" folder tree. The "My Places" folder tree has also been vastly simplified into "On" and "Off" folders (some of which can be expanded).

note: I have only tested this on WinXP with the newest GE beta 4.x, in which case GE transparently loads a <NetworkLink> file from our server when clicking on the "checkbox" or text link. On my test system, the GE web browser pane does not open, nor are you prompted with a window to open the kml file. This might be different on other systems, and would affect the smooth and transparent operation of this idea...

Try it out:

 

How it's done:

Create a Custom Schema

Custom <Schema> example


<Schema parent="Placemark" name="JGI_Placemark">
<SimpleField type="wstring" name="status_archives">
</SimpleField>
<SimpleField type="wstring" name="status_chimp_bios">
</SimpleField>
</Schema>

Create a Balloon Style

Custom <BalloonStyle> example


<BalloonStyle>
<color>ff669999</color>
<text> //Using un-encoded < , >, " here, but for the actual KML, you have to replace with HTML-safe equivalents: &lt; &gt;&quot;
<a href="http://newdms.jamesreserve.edu/kml2_1/scripts/JGI_menu_archives_were_$[status_archives].kml">
<img src="http://newdms.jamesreserve.edu/kml2_1/scripts/checkbox_$[status_archives].gif">
</a> <a href="http://newdms.jamesreserve.edu/kml2_1/images/JGI_menu_chimp_bios_were_$[status_chimp_bios].kml">
<img src="http://newdms.jamesreserve.edu/kml2_1/images/checkbox_$[status_chimp_bios].gif">
</a>
</text>
</BalloonStyle>

Create NetworkLink and NetworkLinkControl to enact the changes

But there are a few more things to consider:

<NetworkLink> example

//NetworkLink loaded by clicking on the fake checkbox

<NetworkLink id="JGI_nwl_archives_on">
<name>(ignore) archives - 'off'</name>

<!-- The user wants to turn the archives to off, so run a <NetworkControlLink> that will <Update> the kml -->
<Link>
<href>http://newdms.jamesreserve.edu/kml2_1/scripts/JGI_menu_update_archives_were_on.kml</href>
</Link>
</NetworkLink>

<NetworkLinkControl> example

//NetworkLinkControl loaded by clicking on the fake checkbox

<NetworkLinkControl>
<!-- Since the user wants to turn off the archives layer--> <!-- ...set the custom schema tag 'status_archives' to off for each menu-ized placemarks -->
<Update>
<targetHref>http://newdms.jamesreserve.edu/kml2_1/JGI.kmz</targetHref>
<Change>
<JGI_Placemark targetId="JGI_pl_id_chimp_bios_Sandi">
<status_archives>off</status_archives>
</JGI_Placemark>
<JGI_Placemark targetId="JGI_pl_id_chimp_bios_Gaia">
<status_archives>off</status_archives>
</JGI_Placemark> <!-- REPEAT for each of the Chimp Bios placemarkers-->
</Change>
</Update>

<!-- Since we are turning archives off, delete the old 'on' NetworkLink in the Temporary Places-->
<Update>
<targetHref>http://newdms.jamesreserve.edu/kml2_1/scripts/JGI_menu_archives_were_off.kml</targetHref>
<Delete>
<NetworkLink targetId="JGI_nwl_archives_off" />
</Delete>
</Update>

<!-- and delete any other old the old 'on/off' NetworkLinks in the Temporary Places --> <targetHref>http://newdms.jamesreserve.edu/kml2_1/scripts/JGI_menu_chimp_bios_were_on.kml</targetHref>
<Delete>
<NetworkLink targetId="JGI_nwl_chimp_bios_on" />
</Delete>
</Update>
<Update>
<targetHref>http://newdms.jamesreserve.edu/kml2_1/scripts/JGI_menu_chimp_bios_were_off.kml</targetHref>
<Delete>
<NetworkLink targetId="JGI_nwl_chimp_bios_off" />
</Delete>
</Update> <!--this will be explained in the next section of the tutorial. It deals with the Radion Folders in My Places--> <!-- Now lets turn on the appropriate radio button folder in the Place side bar -->
<Update>
<targetHref>http://newdms.jamesreserve.edu/kml2_1/JGI.kmz</targetHref>
<Change>
<Folder targetId="JGI_radio_folder_archives_on">
<visibility>0</visibility>
</Folder>
</Change>
</Update>
<Update>
<targetHref>http://newdms.jamesreserve.edu/kml2_1/JGI.kmz</targetHref>
<Change>
<Folder targetId="JGI_radio_folder_archives_off">
<visibility>1</visibility>
</Folder>
</Change>
</Update>

</NetworkLinkControl>
</kml>

There is one final problem:

The solution I came up with was to employ the new "Radio Folder" <ListStyle>.

<NetworkLinkControl> for inclusion in the Radio Folders


<NetworkLink id="JGI_nwl_archives_off">
<name>(radio) archives - 'on'</name>

<!-- The user wants to turn the archives to on, so run a <NetworkControlLink> that will <Update> the kml -->
<Link>
<ref>http://newdms.jamesreserve.edu/kml2_1/scripts/radio/JGI_radio_update_archives_turn_on.kml</ref>
</Link>
</NetworkLink> <NetworkLinkControl> <!-- Since the user wants to turn on the archives layer, set the custom schema tag 'status_archives' to on for each menu-i zed placemark's -->
<Update> <targetHref>http://newdms.jamesreserve.edu/kml2_1/JGI.kmz</targetHref> <Change>
<JGI_Placemark targetId="JGI_pl_id_chimp_bios_Gaia">
<status_archives>on</status_archives>
</JGI_Placemark>
<JGI_Placemark targetId="JGI_pl_id_chimp_bios_Gaia">
<status_archives>on</status_archives>
//...
</Change>
</Update>
</NetworkLinkControl>

Summary and potential applications:

This same technique could be used for a number of other features:

  1. Increasing/decreasing font size, or background colors for placemarker descriptions,
  2. Offering the user "Jump to the Next..." links where they could follow a pre-chosen route between placemark's
  3. Simplifying large and complex KML layers by "Hiding Folder Children" in 'My Places' and offering targeted controls in specific placemarkers.

Shortcomings:

This system fails without a live network connection. It may be possible to make the feature checkbox and text hyperlinks in the Balloon descriptions link to files kept inside a master KMZ file. This way the NetworkLinkControls files can be loaded locally, just how you can load an image (<img src="name.kmz/files/image.jpg" />) from inside a KMZ. Unfortunately, my testing of this concept has failed, as all hyperlinks in balloon descriptions appear to be loaded directly in the web browser window pane, instead of from a local KMZ.

There might be a way "disable" the checkboxes if a live internet connection isn't available. Perhaps another custom KML tag could hold an "image width" value. When first loading the source KMZ, the image would start out at dimensions of 1-by-1 pixel, hiding it from view. Another NetworkLink inside the KMZ would try to access the internet, and if successful, load a NetworkLinkControl that would change the "image width" to the full size of the checkbox, thus making it visible and accessible.