Using Network Links Effectively

Network links allow you to tell more complex and dynamic stories with your KML files. They allow you to do many more things, from keeping content updated to changing content in response to what the user does. You can learn about specifying network links in the KML Reference.

This tutorial explains why network links can make your stories more compelling.

Using KML as a Bookmark

In the most generic sense, a KML file with a network link acts as a gateway into the content on your server. Your users download your KML file just once, but they will always see the most updated content, even if you updated it after they download your KML.

In fact, many content owners choose to have users download a KML file that includes only a network link. The KML file is similar in some ways to a bookmark in a web browser, allowing users to quickly get back to content that they like while allowing the content owner to update content at will. As a side benefit, the initial download of your KML file is always small and fast.

The Google Earth KML Gallery uses this technique for all KML files available for download.

Loading Large Data Sets

Along with regions, network links introduce a powerful mechanism for downloading small parts of large multimedia files only when they're absolutely needed.

Example: 3D Models

3D models can bring more realistic representations of structures and objects to your KML files. However, they can also be quite large in size, resulting in slow downloads if you include them all in a single KMZ file.

One solution is to include links to your 3D models in your placemark balloons. However, that requires users to open placemarks and click links. You might want models to just appear in their geospatial context as the user is flying around.

A network link using the onRegion value for viewRefreshMode is the best solution, because it allow users to download models on-demand, based on where they are flying in Google Earth. The Google 3D Warehouse uses this approach:

KML logo Google 3D Warehouse

Example: Superoverlays

A similar challenge occurs with very large images. If you have large image overlays you'd like to include, you can use a variant of the region-based technique for 3D models. When the user is zoomed out, you can show lower-resolution imagery and as the user zooms into a particular region, you can show the higher-resolution image for that particular region. By using network links you can load the image parts you need on the fly.

To learn how to make use of this technique, take a look at the Super-Overlays tutorial in the KML 2.1 tutorial.

KML logo Global Connection Project's overlay of NOAA images after Hurricane Katrina

Using Real-Time Data

After a user downloads your KML file, even if the user doesn't fly to a specific region, you might want to update your content simply because it has changed. Perhaps you have real-time data from sensors or maybe you're monitoring exit poll results on the night of an election.

Network links allow you to update content based on the passage of time. Using refreshMode and refreshInterval or expires, you can choose to refresh after a few seconds or when a deadline passes.

What does refreshing allow you to do? You could simply reload the entire file behind the original network link. Alternatively, you could change only the parts of the KML that have actually changed. Perhaps you only update sensor placemarks where you have new data or only update districts where new votes have been counted.

Examples

KML logo James Reserve sensor network project

KML logo Global Cloud Map

Discussion/Feedback

Have questions about this tutorial? Want to give us some feedback? Visit the Google Earth Outreach Discussion Group to discuss it with others.

What Next?