Adding untyped data/value pairs using the element (basic) Declaring new typed
fields using the element and then instancing them using the
element (advanced) Referring to XML elements defined in other namespaces by referencing
the external namespace within the KML file (basic)
Allows you to add custom data to a KML file. This data can be (1) data that references
an external XML schema, (2) untyped data/value pairs, or (3) typed data. A given
KML Feature can contain a combination of these types of custom data.
For more information, see Adding Custom Data in "Topics in KML."
The ExtendedData element offers three techniques for adding custom data to a KML
Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document,
Folder). These techniques are
These techniques can be combined within a single KML file or Feature for different
pieces of data.
Creates an untyped name/value pair. The name can have two versions: name and displayName.
The name attribute is used to identify the data pair within the KML file. The displayName
element is used when a properly formatted name, with spaces and HTML formatting,
is displayed in Google Earth. In the element of , the notation
$[name:displayName] is replaced with . If you substitute the value
of the name attribute of the element in this format (for example, $[holeYardage],
the attribute value is replaced with . By default, the Placemark's balloon
displays the name/value pairs associated with it.
The can be a full URL, a reference to a Schema ID defined in an external
KML file, or a reference to a Schema ID defined in the same KML file. All of the
following specifications are acceptable:
The Schema element is always a child of Document. The ExtendedData element is a
child of the Feature that contains the custom data.
This element is used in conjunction with to add typed custom data to a
KML Feature. The Schema element (identified by the schemaUrl attribute) declares
the custom data type. The actual data objects ("instances" of the custom data) are
defined using the SchemaData element.
Creates a new instance of SchemaData and adds it to schemaData.
This method is a short version for:
SchemaData schemaData = new SchemaData();
this.getSchemaData().add(schemaData);