OpenLayers.Protocol.WFS.v1

Abstract class for for v1.0.0 and v1.1.0 protocol.

Inherits from

Summary
OpenLayers.Protocol.WFS.v1Abstract class for for v1.0.0 and v1.1.0 protocol.
Constructor
OpenLayers.Protocol.WFSA class for giving layers WFS protocol.
Functions
destroyClean up the protocol.
readConstruct a request for reading new features.
setFeatureTypeChange the feature type on the fly.
setGeometryNameSets the geometryName option after instantiation.

Constructor

OpenLayers.Protocol.WFS

A class for giving layers WFS protocol.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Valid options properties

url{String} URL to send requests to (required).
featureType{String} Local (without prefix) feature typeName (required).
featureNS{String} Feature namespace (required, but can be autodetected during the first query if GML is used as readFormat and featurePrefix is provided and matches the prefix used by the server for this featureType).
featurePrefix{String} Feature namespace alias (optional - only used for writing if featureNS is provided).  Default is ‘feature’.
geometryName{String} Name of geometry attribute.  The default is ‘the_geom’ for WFS <version> 1.0, and null for higher versions.  If null, it will be set to the name of the first geometry found in the first read operation.
multi{Boolean} If set to true, geometries will be casted to Multi geometries before they are written in a transaction.  No casting will be done when reading features.

Functions

destroy

destroy: function()

Clean up the protocol.

read

read: function(options)

Construct a request for reading new features.  Since WFS splits the basic CRUD operations into GetFeature requests (for read) and Transactions (for all others), this method does not make use of the format’s read method (that is only about reading transaction responses).

Parameters

options{Object} Options for the read operation, in addition to the options set on the instance (options set here will take precedence).

To use a configured protocol to get e.g. a WFS hit count, applications could do the following:

protocol.read({
    readOptions: {output: "object"},
    resultType: "hits",
    maxFeatures: null,
    callback: function(resp) {
        // process resp.numberOfFeatures here
    }
});

To use a configured protocol to use WFS paging (if supported by the server), applications could do the following:

protocol.read({
    startIndex: 0,
    count: 50
});

To limit the attributes returned by the GetFeature request, applications can use the propertyNames option to specify the properties to include in the response:

protocol.read({
    propertyNames: ["DURATION", "INTENSITY"]
});

setFeatureType

setFeatureType: function(featureType)

Change the feature type on the fly.

Parameters

featureType{String} Local (without prefix) feature typeName.

setGeometryName

setGeometryName: function(geometryName)

Sets the geometryName option after instantiation.

Parameters

geometryName{String} Name of geometry attribute.
destroy: function()
Clean up the protocol.
read: function(options)
Construct a request for reading new features.
setFeatureType: function(featureType)
Change the feature type on the fly.
setGeometryName: function(geometryName)
Sets the geometryName option after instantiation.
Abstract vector layer protocol class.
Close