Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 17 — History and Planning with Google Earth 331


Adding Detail to a Placemark


The info window in Google Maps is an effective way of providing more detailed information
for a placemark. Google Earth automatically creates these windows based on information
within the tag within a placemark. For example, the Pompeii town square
placemark can be described using this:


The Pompeii town square photo was taken here.

The content in this section can be plain text, as shown here, but it can also be HTML. To
embed HTML it must be escaped. There is a longer solution for this that requires escaping the
HTML (particularly the angle brackets), like this:


The main square of Pompeii, looking towards the ;
temple. <img src=”images/DSC01155.JPG”>

A simpler method is to use the XML data embedding format. For example, you could include
the photo in the placemark window using the following:


temple. ]]>

Using this method, the points on the map could be returned to standard placemarks and the
placemark window used to display the photo.


Final KML.


Putting everything in the previous sections together, you can build a single KML file that
describes a number of points, and the photos taken at those points, for the trip to Pompeii.
Only three points are detailed here, but an unlimited number could theoretically be introduced:


<?xml version=”1.0” encoding=”UTF-8”?>




Pompeii.kmz

Pompeii
1

Council Building
the main square. ]]>
1

14.48469513913974
40.75006838268123
0
498.0008872980769
67.6354076394704
105.3299769917819
Free download pdf