Right Column
Format of a KML File - Explained
Here two CSUs (California State Universities) are shown on the map based on the KML file shown below the map.
Demo Utilizing Google Maps
Use the following KML file to view this same map information in: Google Earth, Microsoft Virtual Earth, etc.
The "Tagged" Information Within the KML File (of the Map Info Shown Above)
First we see the tags and data that establishes what icon image will be used for showing the placemark on the map. (In this case, it is for the little green house shown on the map above.) You will first notice that the placemark "style", image file, is referenced twice. In reality, the second image could be a totally different image. The reason for two being used in a "style" is for showing the placemark icons in products like Google Earth. In Google Earth, when you move the mouse over the icon, the second image of the icon will show up - in this case highlighting the icon because the second image is being shown full size. But in plain Google Maps (as shown above) you do not get this enhanced behavior.
Next in the KML file we see the actual code for the individual placemarks. Shown here are the two different ways that the HTML code can be coded within the "description" tag. The first method is using "escape" codes for specially recognized HTML characters of "<" and ">" and quotation marks themselves. The second method shown for the second placemark keeps the HTML code in its original state, but has to utilize another special type of "escape" identification: the code that includes "[CDATA[" before the HTML, and the "]]" after the HTML (see below).
Note how the placemark style is assigned to each placemark via the "styleURL" tag.
Finally, the most important "coordinates" tag must be included for each placemark. The first number represents the "longitude", the second the "latitude" and the third is the elevation. For the simple representation of placemarks we are doing, we can always leave the last corrdinate at a value of "0".
