Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Generating Google


Earth Feeds


W


ith Google Maps, the JavaScript language and Google Maps
object environment were required to build the marker and then
overlay the marker onto the Google Map. Google Earth pro-
vides a much simpler method for adding points of interest to the map. With
Google Earth, the Google Earth application does all of the overlay legwork.
All you need to do is create a suitable KML file that provides the bare
structure and coordinates of the point you want to highlight.

Because there is no programming involved, the structure and content of the
KML file is critical. This chapter describes the basics of the KML file for-
mat required for a basic point, along with some extensions and examples of
dynamism that can be added to the system.

Showing Points


The basic KML point is the <Placemark>tag. There were some examples
of this in the previous chapter, but the structure is quite straightforward.
Only two components are required for a <Placemark>tag: the name and
the point (containing coordinates for latitude/longitude) to which the point
refers. You can also add further information, such as the <address>tag,
icons, and further descriptive data to the <Placemark>tag according to
your needs.

For example, here’s a small <Placemark>tag defining the location of the
Yorkshire Bank in Grantham:
<Placemark>
<name>Yorkshire Bank</name>
<address>10 High St,Grantham, NG31 6PU, United
Kingdom</address>
<Point>
<coordinates>-0.642539,52.913,0</coordinates>
</Point>
</Placemark>

The <coordinates>tag specifies the longitude, latitude, and altitude of
the point, in that order, separated by a comma.

̨Create KML
placemarks

̨Update KML
dynamically

̨Link to networks


chapter


in this chapter

Free download pdf