Abstract class for for v1.0.0 and v1.1.0 protocol.
OpenLayers.
|
Abstract class for for v1.0.0 and v1.1.0 protocol. |
Constructor | |
OpenLayers.
|
A class for giving layers WFS protocol. |
Functions | |
destroy | Clean up the protocol. |
read | Construct a request for reading new features. |
setFeatureType | Change the feature type on the fly. |
setGeometryName | Sets the geometryName option after instantiation. |
A class for giving layers WFS protocol.
options | {Object} Optional object whose properties will be set on the instance. |
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. |
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).
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"] });
Clean up the protocol.
destroy: function()
Construct a request for reading new features.
read: function( options )
Change the feature type on the fly.
setFeatureType: function( featureType )
Sets the geometryName option after instantiation.
setGeometryName: function( geometryName )