Child pages
  • Google Maps Placeholder in KML
Skip to end of metadata
Go to start of metadata
Note from [Mike Fourman] at 29-Sep-2011
I have a link with the Ecole Polytechnique at Saclay. To obtain the address and coordinates I use the google geocode api:

http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Ecole%20Polytechnique%20Saclay

( %20 replaces each space )

This gives an xml response (you can see the response directly in firefox, safari or chrome) containing, inter alia, the address and coordinates:

<formatted_address>École Polytechnique, 91120 Palaiseau, France</formatted_address>

<location>
<lat>48.7142971</lat>
<lng>2.2112917</lng>
</location>

I use the placemark template given at
http://code.google.com/apis/kml/documentation/kml_tut.html#placemarks

to construct the following xml (kml) document

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Placemark expiry="31/12/2013" contact="mfourman">
      <name>École Polytechnique, 91120 Palaiseau, France</name>
      <description>
        <![CDATA[
          <h1><a href="http://www.lix.polytechnique.fr/">École Polytechnique, 91120 Palaiseau, France</a></h1>
          <p><a href="http://bit.ly/mp4man">Michael Fourman</a> is a member of the Commission de Recrutement d'Informatique.</p>
        ]]>
      </description>
      <Point>
        <coordinates>2.2112917, 48.7142971</coordinates>
      </Point>
    </Placemark>
  </Document>
</kml>
Note that the coordinates are in <coordinates> lng, lat </coordinates> order!
Please add expiry (remove-by date) and contact (your uun) attributes as in this example.
The body of your description can include html tags, but must be enclosed in a CDATA section, as in this example.
In summary, you should replace the content of the following items:

expiry
contact
name
description CDATA
coordinates

If you have several international links, you can include multiple Placemarks within the Document tags.

You can test your kml by opening it in google earth.

Notes Table

The table below is a quick notes area for those who want to prepare to make such an entry...

Dates (expiry)

UoE UUN (contact)

International Name (name)

International Description (description CDATA)

Location (coordinates)

 

 

 

 

 

 

 

 

 

 

  • No labels