Base class for format reading/writing a variety of formats.
NAME | DESCRIPTION |
---|---|
options | {Object} A reference to options passed to the constructor. |
externalProjection | {ZOO.Projection} When passed a externalProjection and internalProjection, the format will reproject the geometries it reads or writes. |
internalProjection | {ZOO.Projection} When passed a externalProjection and internalProjection, the format will reproject the geometries it reads or writes. |
data | {Object} When keepData is true, this is the parsed string sent to read. |
keepData | {Object} Maintain a reference (data) to the most recently read data. |
NAME | DESCRIPTION |
---|---|
ZOO.Format | Instances of this class are not useful. |
destroy | Clean up. |
read | Read data from a string, and return an object whose type depends on the subclass. |
data | {Object} When keepData is true, this is the parsed string sent to read. |
write | Accept an object, and return a string. |
Properties
Functions
Instances of this class are not useful. See one of the subclasses.
Parameters
options {Object} An optional object with properties to set on the format
Valid options
keepData {Boolean} If true, upon read, the data property will be set to the parsed object (e.g. the json or xml object).
Returns
An instance of ZOO.Format
destroy: function()
Clean up.
read: function(data)
Read data from a string, and return an object whose type depends on the subclass.
Parameters
data {string} Data to read/parse.
Returns
Depends on the subclass
write: function(data)
Accept an object, and return a string.
Parameters
object {Object} Object to be serialized
Returns
{String} A string representation of the object.