OpenLayers. Format.KML

Read/Wite KML.  Create a new instance with the OpenLayers.Format.KML constructor.

Inherits from

Summary
Read/Wite KML.
{String} KML Namespace to use.
{String} Name of the placemarks.
{String} Name of the folders.
{String} Description of the folders.
{Boolean} Extract attributes from KML.
Create a new parser for KML.
Read data from a string, and return a list of features.
Accept Feature Collection, and return a string.

Properties

kmlns

{String} KML Namespace to use.  Defaults to 2.0 namespace.

placemarksDesc

{String} Name of the placemarks.  Default is “No description available.”

foldersName

{String} Name of the folders.  Default is “OpenLayers export.”

foldersDesc

{String} Description of the folders.  Default is “Exported on [date].”

extractAttributes

{Boolean} Extract attributes from KML.  Default is true.

Constructor

OpenLayers. Format.KML

Create a new parser for KML.

Parameters

options{Object} An optional object whose properties will be set on this instance.

Functions

read

read: function(data)

Read data from a string, and return a list of features.

Parameters

data{String} or {DOMElement} data to read/parse.

Returns

{Array(OpenLayers.Feature.Vector)} List of features.

write

write: function(features)

Accept Feature Collection, and return a string.

Parameters

featuresAn array of OpenLayers.Feature.Vector features.

Returns

{String} A KML string.

read: function(data)
Read data from a string, and return a list of features.
write: function(features)
Accept Feature Collection, and return a string.
Create a new parser for KML.
Read and write XML.
Vector features use the OpenLayers.Geometry classes as geometry description.