Read/Write KML. Create a new instance with the OpenLayers.Format.KML constructor.
OpenLayers.
|
Read/Write 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. |
kvpAttributes | {Boolean} Only used if extractAttributes is true. |
extractTracks | {Boolean} Extract gx:Track elements from Placemark elements. |
trackAttributes | {Array} If extractTracks is true, points within gx:Track elements will be parsed as features with when, heading, tilt, and roll attributes. |
maxDepth | {Integer} Maximum depth for recursive loading external KML URLs Defaults to 0: do no external fetching |
Constructor | |
OpenLayers.
|
Create a new parser for KML. |
Functions | |
read | Read data from a string, and return a list of features. |
write | Accept Feature Collection, and return a string. |
{Boolean} Only used if extractAttributes is true. If set to true, attributes will be simple key-value pairs, compatible with other formats, Any displayName elements will be ignored. If set to false, attributes will be objects, retaining any displayName elements, but not compatible with other formats. Any CDATA in displayName will be read in as a string value. Default is false.
{Boolean} Extract gx:Track elements from Placemark elements. Default is false. If true, features will be generated for all points in all gx:Track elements. Features will have a when (Date) attribute based on when elements in the track. If tracks include angle elements, features will have heading, tilt, and roll attributes. If track point coordinates have three values, features will have an altitude attribute with the third coordinate value.
{Array} If extractTracks is true, points within gx:Track elements will be parsed as features with when, heading, tilt, and roll attributes. Any additional attribute names can be provided in trackAttributes.
read: function( data )
Read data from a string, and return a list of features.
data | {String} or {DOMElement} data to read/parse. |
{Array(OpenLayers.Feature.Vector)} List of features.
write: function( features )
Accept Feature Collection, and return a string.
features | {Array(OpenLayers.Feature.Vector)} An array of features. |
{String} A KML string.
Read data from a string, and return a list of features.
read: function( data )
Accept Feature Collection, and return a string.
write: function( features )