# OpenLayers.Format.Filter.v1

Superclass for Filter version 1 parsers.

#### Inherits from

- OpenLayers.Format.XML

Summary

OpenLayers.Format.Filter.v1 | Superclass for Filter version 1 parsers.
Properties |
namespaces | {Object} Mapping of namespace aliases to namespace URIs.
defaultPrefix |
schemaLocation | {String} Schema location for a particular minor version.
Constructor |
OpenLayers.Format.Filter.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.
readSpatial | Read a {OpenLayers.Filter.Spatial} filter.
encodeLiteral | Generates the string representation of a value for use in <Literal> elements.
writeOgcExpression | Limited support for writing OGC expressions.
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.
getFilterType |
filterMap | {Object} Contains a member for each filter type.

### Properties

### namespaces

{Object} Mapping of namespace aliases to namespace URIs.

### defaultPrefix

### schemaLocation

{String} Schema location for a particular minor version.

### Constructor

### OpenLayers.Format.Filter.v1

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

#### Parameters

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

### Functions and Properties

### read

> read: function( | data | )

#### Parameters

data | {DOMElement} A Filter document element.

#### Returns

{OpenLayers.Filter} A filter object.

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

### readSpatial

> readSpatial: function( | node,
> | obj,
> | type | )

Read a {OpenLayers.Filter.Spatial} filter.

#### Parameters

node | {DOMElement} A DOM element that contains an ogc:expression.
obj | {Object} The target object.
type | {String} One of the OpenLayers.Filter.Spatial.* constants.

#### Returns

{OpenLayers.Filter.Spatial} The created filter.

### encodeLiteral

> encodeLiteral: function( | value | )

Generates the string representation of a value for use in <Literal> elements. The default encoder writes Date values as ISO 8601 strings.

#### Parameters

value | {Object} Literal value to encode

#### Returns

{String} String representation of the provided value.

### writeOgcExpression

> writeOgcExpression: function( | value,
> | node | )

Limited support for writing OGC expressions. Currently it supports (OpenLayers.Filter.Function || String || Number)

#### Parameters

value | (OpenLayers.Filter.Function || String || Number)
node | {DOMElement} A parent DOM element

#### Returns

{DOMElement} Updated node element.

### write

> write: function( | filter | )

#### Parameters

filter | {OpenLayers.Filter} A filter object.

#### Returns

{DOMElement} An ogc:Filter element.

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

### getFilterType

> getFilterType: function( | filter | )

### filterMap

{Object} Contains a member for each filter type. Values are node names for corresponding OGC Filter child elements.

> read: function( | data | )

> readSpatial: function( | node,
> | obj,
> | type | )

Read a {OpenLayers.Filter.Spatial} filter.
This class represents a spatial filter.

> encodeLiteral: function( | value | )

Generates the string representation of a value for use in Literal elements.

> writeOgcExpression: function( | value,
> | node | )

Limited support for writing OGC expressions.

> write: function( | filter | )

> getFilterType: function( | filter | )

Read and write XML.
Read/Write ogc:Filter.
This class represents an OGC Filter.
This class represents a filter function.
Close