Superclass for SLD version 1 parsers.
| OpenLayers. Format. SLD.v1 | Superclass for SLD version 1 parsers. |
| Properties | |
| namespaces | {Object} Mapping of namespace aliases to namespace URIs. |
| defaultPrefix | |
| schemaLocation | {String} Schema location for a particular minor version. |
| defaultSymbolizer. | {Object} A symbolizer with the SLD defaults. |
| Constructor | |
| OpenLayers. Format. SLD.v1 | Instances of this class are not created directly. |
| Functions and Properties | |
| read | |
| readers | Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name. |
| cssMap | {Object} Object mapping supported css property names to OpenLayers symbolizer property names. |
| getCssProperty | Given a symbolizer property, get the corresponding CSS property from the cssMap. |
| getGraphicFormat | Given a href for an external graphic, try to determine the mime-type. |
| defaultGraphicFormat | {String} If none other can be determined from getGraphicFormat, this default will be returned. |
| graphicFormats | {Object} Mapping of image mime-types to regular extensions matching well-known file extensions. |
| write | |
| writers | As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce. |
| getNamespacePrefix | Get the namespace prefix for a given uri from the namespaces object. |
| readChildNodes | |
| writeNode | Shorthand for applying one of the named writers and appending the results to a node. |
| createElementNSPlus | Shorthand for creating namespaced elements with optional attributes and child text nodes. |
| setAttributes | Set multiple attributes given key value pairs from an object. |
Instances of this class are not created directly. Use the OpenLayers.Format.SLD constructor instead.
| options | {Object} An optional object whose properties will be set on this instance. |
getCssProperty: function( sym )
Given a symbolizer property, get the corresponding CSS property from the cssMap.
| sym | {String} A symbolizer property name. |
{String} A CSS property name or null if none found.
getGraphicFormat: function( href )
Given a href for an external graphic, try to determine the mime-type. This method doesn’t try too hard, and will fall back to <defautlGraphicFormat> if one of the known graphicFormats is not the file extension of the provided href.
| href | {String} |
{String} The graphic format.
{String} If none other can be determined from getGraphicFormat, this default will be returned.
getNamespacePrefix: function( uri )
Get the namespace prefix for a given uri from the namespaces object.
{String} A namespace prefix or null if none found.
writeNode: function( parent, name, obj )
Shorthand for applying one of the named writers and appending the results to a node. If a qualified name is not provided for the second argument (and a local name is used instead), the namespace of the parent node will be assumed.
| parent | {DOMElement} Result will be appended to this node. |
| name | {String} The name of a node to generate. If a qualified name (e.g. “pre:Name”) is used, the namespace prefix is assumed to be in the writers group. If a local name is used (e.g. “Name”) then the namespace of the parent is assumed. |
| obj | {Object} Structure containing data for the writer. |
{DOMElement} The child node.
setAttributes: function( node, obj )
Set multiple attributes given key value pairs from an object.
| node | {Element} An element node. |
| obj | {Object || Array} An object whose properties represent attribute names and values represent attribute values. If an attribute name is a qualified name (“prefix:local”), the prefix will be looked up in the parsers {namespaces} object. If the prefix is found, setAttributeNS will be used instead of setAttribute. |
read: function( data )
Given a symbolizer property, get the corresponding CSS property from the cssMap.
getCssProperty: function( sym )
Given a href for an external graphic, try to determine the mime-type.
getGraphicFormat: function( href )
write: function( sld )
Get the namespace prefix for a given uri from the namespaces object.
getNamespacePrefix: function( uri )
readChildNodes: function( node, obj )
Shorthand for applying one of the named writers and appending the results to a node.
writeNode: function( parent, name, obj )
Shorthand for creating namespaced elements with optional attributes and child text nodes.
createElementNSPlus: function( name, options )
Set multiple attributes given key value pairs from an object.
setAttributes: function( node, obj )