# OpenLayers.Format.SLD.v1

Superclass for SLD version 1 parsers.

#### Inherits from

- OpenLayers.Format.Filter.v1_0_0

Summary

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.
multipleSymbolizers | {Boolean} Support multiple symbolizers per rule.
featureTypeCounter | {Number} Private counter for multiple feature type styles.
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.

### Properties

### namespaces

{Object} Mapping of namespace aliases to namespace URIs.

### defaultPrefix

### schemaLocation

{String} Schema location for a particular minor version.

### multipleSymbolizers

{Boolean} Support multiple symbolizers per rule. Default is false. if true, an OpenLayers.Style2 instance will be created to represent user styles instead of an OpenLayers.Style instace. The OpenLayers.Style2 class allows collections of rules with multiple symbolizers, but is not currently useful for client side rendering. If multiple symbolizers is true, multiple FeatureTypeStyle elements are preserved in reading/writing by setting symbolizer zIndex values. In addition, the defaultSymbolizer property is ignored if multiple symbolizers are supported (defaults should be applied when rendering).

### featureTypeCounter

{Number} Private counter for multiple feature type styles.

### defaultSymbolizer.

{Object} A symbolizer with the SLD defaults.

### Constructor

### OpenLayers.Format.SLD.v1

Instances of this class are not created directly. Use the OpenLayers.Format.SLD constructor instead.

#### Parameters

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

### Functions and Properties

### read

> read: function( | data,
> | options | )

#### Parameters

data | {DOMElement} An SLD document element.
options | {Object} Options for the reader.

#### Valid options

namedLayersAsArray | {Boolean} Generate a namedLayers array. If false, the namedLayers property value will be an object keyed by layer name. Default is false.

#### Returns

{Object} An object representing the SLD.

### readers

Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name. The function will be applied in the scope of this parser with two arguments: the node being read and a context object passed from the parent.

### cssMap

{Object} Object mapping supported css property names to OpenLayers symbolizer property names.

### getCssProperty

> getCssProperty: function( | sym | )

Given a symbolizer property, get the corresponding CSS property from the cssMap.

#### Parameters

sym | {String} A symbolizer property name.

#### Returns

{String} A CSS property name or null if none found.

### getGraphicFormat

> 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 defaultGraphicFormat if one of the known graphicFormats is not the file extension of the provided href.

#### Parameters

href | {String}

#### Returns

{String} The graphic format.

### 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

> write: function( | sld | )

#### Parameters

sld | {Object} An object representing the SLD.

#### Returns

{DOMElement} The root of an SLD document.

### 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.

> read: function( | data,
> | options | )

> getCssProperty: function( | sym | )

Given a symbolizer property, get the corresponding CSS property from the cssMap.
{Object} Object mapping supported css property names to OpenLayers symbolizer property names.

> getGraphicFormat: function( | href | )

Given a href for an external graphic, try to determine the mime-type.

> write: function( | sld | )

Write ogc:Filter version 1.0.0.
{Object} A symbolizer with the SLD defaults.
Read/Write SLD.
{String} If none other can be determined from getGraphicFormat, this default will be returned.
{Object} Mapping of image mime-types to regular extensions matching well-known file extensions.
Close