Network Links are a very powerful, but very simple, feature of Google Earth that every Google Earth user should understand. Also, EVERY Google Earth content developer that hosts KML/KMZ files online should understand Network Links and make use of them when it makes sense. So take a couple minutes and read below to learn how to make use of this powerful feature of Google Earth.
Normally when you add custom KML content to you My Places, all of the data included with that custom KML file gets added to your main myplaces.kml file (saved under Documents and Settings\username\Application Data\Google\GoogleEarth\myplaces.kml). For example, if you were to click on this KMZ file link and save the content to your permanent My Places folder in Google Earth, then you would have just made your myplaces.kml file about 15 megabytes larger than it was before and you would notice that it now takes Google Earth several more seconds to start up. Do this 10 or 15 times and your myplaces.kml file can quickly grow out of control. Also, if the original author of that KMZ file updates it, then you would need to go back to their website and download it again to get the update.
If instead, you decide to use a Network Link, some important things will happen:
- Instead of your myplaces.kml file becoming 15 megabytes larger, it will only become 1-2 kilobytes larger. You can add 1,000′s of Network Links without having to worry about the size of your myplaces.kml file.
- If you create a Network Link to a remotely hosted KML file, and the original author of that KML file decides to update it in the future (and doesn’t change the url/filename), then that update will automatically transfer to your machine.
- If you create a Network Link to a KML file stored on your local hard drive, then it won’t affect the size of your myplaces.kml file and won’t affect Google Earth’s load time.
How does all this happen? Simple, because the Network Link does not load the actual KMZ file until you enable the Network Link in Google Earth by checking the box next to it. The table below gives some recommendations on when to use Network Links, and what type of Network Link to use.
|Network Link to Remote URL:||
|Network Link to local file on hard drive:||
|Network Link Not Necessary:||
Creating a Network Link:
If your still reading, then I must have convinced you Network Links are a good thing. So how do you create a Network Link? Simple:
- Copy the URL of the KML/KMZ file that you want to add. (right-click on the link and select Copy Link Location or Copy Shortcut).
- Go to Google Earth and select Network Link from the Add menu at the top.
- Put your cursor in the box next to Link and hit CTRL-P to paste the URL of the KMZ file into that box.
- Type in something in the Name field at the top.
- That’s it. Leave everything else as the default values.
Congratulations, you’ve just created a Network Link. Now you can save the Network Link under your permanent My Places folder in Google Earth just like you normally would.
You can also use Network Links for content stored on your local hard drive. Instead of pasting the URL into the Link box, just click Browse and select the file on your local hard drive.
If you host KMZ/KML files online, you should consider using Network Links when it makes sense. The advantages are that the user will not have to manually create one and if you update your KML code in the future, the update will automatically propogate to the user. Also, users can pass around a Network Link through email, etc, much easier than the larger KML/KMZ file. The disadvantage of course is increased load on your server since the users will be downloading the main KML file each time they access it.
Or maybe even give the user the option of choosing between direct download of the entire KML/KMZ file or a Network Link. In fact, as I write this, I’m thinking I may add this option to files on my blog.
Below is some sample code for a very basic Network Link. Simply fill in the Name, Description and the URL to the KMZ/KML file that you want it to load. Then save as KML file and use this for the link the users will click on to access files on your website.
|<?xml version=”1.0? encoding=”UTF-8″”>
<kml xmlns=”http://www.opengis.net/kml/2.2? xmlns:gx=”http://www.google.com/kml/ext/2.2″ xmlns:kml=”http://www.opengis.net/kml/2.2? xmlns:atom=”http://www.w3.org/2005/Atom”>
That’s it. If you have any other suggestions or tips regarding Network Links, please leave a comment below.