Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 16 — Generating Google Earth Feeds 317


Subscribing to a Network Resource


The CGI method shown in the previous section generates the necessary KML with the correct
headers and structure. However, you need to load the file within Google Earth using a specific
option so that that the KML is requested from the URL, rather than loaded from a file.


To add a network resource to your Google Earth application, you choose Network Link from
the Add menu in Google Earth. You are presented with a window like the one shown in
Figure 16-3.


FIGURE16-3: Opening Network resources in Google Earth.


Give the Network Link a name. In the Location field, provide the URL of the CGI script that
generates the KML. To use the previously detailed example script, use the URL http://
maps.mcslp.com/examples/ch16-02.cgi.


You should get a Google Earth display like the one in Figure 16-4.

Free download pdf