Search code examples
kml

KML description overshadows ExtendedData


I have a placemark feature containing some ExtendedData fields as a KML file. I would also like to include a description for this placemark, and have both the description and the ExtendedData appear in the balloon for the placemark.

The problem is, when I bring any modification to the description, all ExtendedData fields disappear, and are replaced by the newly entered description. However I know they are still there because when I copy the placemark into a text editor I can see that both tags are still there.

Is there any way to have both the description and the placemark appear in the balloon at the same time?


Solution

  • Google Earth displays the extended data fields formatted as HTML-table in the pop-up description box only when the description field of the placemark or feature is missing. If a feature contains a description then that description text is what is displayed when a user clicks on that feature in a pop-up description box.

    If you want to have both extended data fields and a custom description then you can either 1) duplicate the data in the description or 2) use a shared BallonStyle with the ExtendedData names as placeholders in a template.

    Here is a simple example of using ExtendedData with a BalloonStyle:
    http://kml-samples.googlecode.com/svn/trunk/kml/ExtendedData/data-golf.kml

    Tutorial including using the BalloonStyle element as a template:
    https://developers.google.com/kml/documentation/extendeddata