OpenLayers.Format.KML

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

Inherits from

Summary
OpenLayers.Format.KMLRead/Wite KML.
Properties
kmlns{String} KML Namespace to use.
placemarksDesc{String} Name of the placemarks.
foldersName{String} Name of the folders.
foldersDesc{String} Description of the folders.
extractAttributes{Boolean} Extract attributes from KML.
maxDepth{Integer} Maximum depth for recursive loading external KML URLs Defaults to 0: do no external fetching
Constructor
OpenLayers.Format.KMLCreate a new parser for KML.
Functions
readRead data from a string, and return a list of features.
writeAccept 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.  Extracting styleUrls requires this to be set to true

maxDepth

{Integer} Maximum depth for recursive loading external KML URLs Defaults to 0: do no external fetching

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

features{Array(OpenLayers.Feature.Vector} An array of 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.
Close