Creates a new WFSFeatureStore.
An object containing the configuration settings for this store.
Data bounds as specified by the BBOX parameter in the WFS capabilities, if the store is created from
WFS capabilities, otherwise undefined.
Indicates whether credentials should be included with HTTP requests.
Set this to true if the server requires credentials, like HTTP basic authentication headers or cookies.
You should disable credentials if the server is configured to allow cross-origin requests from all domains (Access-Control-Allow-Origin=*).
If the server allows CORS requests from all domains, the browser will block all requests where credentials=true.
Once set, all later HTTP requests will use the newly set value.
The default value is false.
Headers to send with every HTTP request.
An object literal that represents the headers to send with every HTTP request. The property names represent HTTP header names, the property values represent the HTTP header values. This property can be set dynamically (post-construction). Once set, all later HTTP requests will use the newly set headers.
Note that when custom headers are being sent to a server on another domain, the server will have to properly
respond to pre-flight CORS requests (an HTTP OPTION request sent by the browser before doing the actual request).
The server must indicate that the header is allowed in the actual request by including it in
the preflight Access-Control-Allow-Headers response header.
The default value is null.
Custom request parameters to send along with WFS requests. The object literal can contain simple key/value pairs. Accepted values are strings, numbers, and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.
Assignments of other values than object literals to requestParameters will throw an Error.
You can clear the parameters by assigning null or an empty object literal.
To refresh the visualization on the map, call layer.loadingStrategy.queryProvider.invalidate().
Adds a feature to the WFS service using a <wfs:Transaction> Insert operation.
If the server returns a feature ID, the feature's id is updated.
the feature to insert
the feature ID assigned by the server
WFSTransactionError if the WFS-T operation fails
InvalidXMLError if the server response is not well-formed XML
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
ProgrammingError if the service does not support this operation according to its capabilities,
or if feature.shape.reference does not match the store's reference
ProtectedemitRetrieves a feature from the WFS service by ID.
the feature ID
Optionaloptions: QueryOptions
options for the request
the feature, or undefined if no feature with the given ID exists
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
Indicates whether the given operation can be called without throwing
ProgrammingError. This store always exposes every operation, but the WFS service it
talks to decides which of them actually work: add, put and remove require a WFS 2.x
service that advertises the Transaction operation, and lockFeatures / queryWithLock
require LockFeature / GetFeatureWithLock.
Acquires a WFS 2.0 lock on features matching filter using <wfs:LockFeature>.
The returned WFSLockFeaturesResult.lock can be passed to put and remove
and released with WFSLock.release.
The caller is responsible for tracking which feature IDs are covered by the lock.
Optionalfilter: OGCCondition
OGC condition or identifiers identifying the features to lock. Omit to lock every feature of the type.
Optionaloptions: WFSLockOptions
lock options
the lock result, including locked and non-locked feature IDs. If lockAction="SOME"
locks no features, lock is null
WFSTransactionError if the WFS-T operation fails
InvalidXMLError if the server response is not well-formed XML
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
ProgrammingError if the service does not support this operation according to its capabilities
Updates an existing feature using a <wfs:Transaction> Update operation.
All defined properties and the geometry are sent to the server. Set a property to null to clear it.
Properties that are undefined or absent from feature.properties are omitted and left unchanged on the server.
Pass options.lock, returned by lockFeatures or queryWithLock, when updating
a locked feature. By default, only the updated feature is released from the lock (releaseAction="SOME").
Use releaseAction="ALL" to release all features covered by the lock.
the feature to update; feature.id must be set
Optionaloptions: WFSTransactionOptions
transaction options
the feature ID
WFSTransactionError if the WFS-T operation fails, including when no feature matches feature.id
InvalidXMLError if the server response is not well-formed XML
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
ProgrammingError if the service does not support this operation according to its capabilities,
or if feature.shape.reference does not match the store's reference
Queries the store for objects. This sends a request to the WFS server. The store invokes Codec.decode to decode the server response, passing the reference specified in the constructor options WFSFeatureStoreConstructorOptions.reference.
Optionalquery: WFSQueryOptions
An object literal that contains the query parameters.
Optionaloptions: QueryOptions
An object literal containing options for the query method.
A promise for a cursor of Feature instances corresponding to the server response.
RequestError if the HTTP request fails and isn't recoverable as an OGC exception.
Queries features and acquires a lock on them atomically using <wfs:GetFeatureWithLock>.
The returned WFSQueryWithLockResult.lock can be passed to put and remove
and released with WFSLock.release.
Unlike lockFeatures, this method cannot report features that it could not lock when lockAction="SOME",
because the response does not include that information.
The response is always decoded using the store's transactionCodec.
Optionalquery: WFSQueryOptions
Query parameters. Omit or pass an empty object to query and lock every feature of the type.
Optionaloptions: WFSLockOptions
lock options
the decoded feature cursor and lock
WFSTransactionError if the WFS-T operation fails
InvalidXMLError if the server response is not well-formed XML
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
ProgrammingError if the service does not support this operation according to its capabilities
Removes a feature using a <wfs:Transaction> Delete operation.
Pass options.lock, returned by lockFeatures or queryWithLock, when removing
a locked feature. By default, only the removed feature is released from the lock (releaseAction="SOME").
Use releaseAction="ALL" to release all features covered by the lock.
the ID of the feature to remove
Optionaloptions: WFSTransactionOptions
transaction options
true on success
WFSTransactionError if the WFS-T operation fails
InvalidXMLError if the server response is not well-formed XML
RequestError if the HTTP request fails and cannot be recovered as an OGC exception
ProgrammingError if the service does not support this operation according to its capabilities
Queries the store for objects within a spatial extent. This sends a request to the WFS server. The store invokes Codec.decode to decode the server response, passing the reference specified in the constructor options WFSFeatureStoreConstructorOptions.reference.
Optionalbounds: Bounds
The spatial extent to retrieve features for.
Optionalquery: WFSQueryOptions
An object literal that contains the query parameters.
Optionaloptions: QueryOptions
An object literal containing options for the query method.
A promise resolving to a cursor of Feature instances corresponding to the server response.
RequestError if the HTTP request fails and isn't recoverable as an OGC exception.
StaticcreateCreates a WFSFeatureStore from server capabilities. This is the recommended way to create the store and is required to use WFS-T operations such as add, put, remove, lockFeatures, and queryWithLock.
The WFS server capabilities.
The name of the WFS feature type to load. Prefer the name without the prefix (places
rather than ns4:places): servers can generate prefixes that differ between WFS versions.
Optionaloptions: WFSFeatureStoreCreateOptions<TFeature>
Additional store settings
a WFSFeatureStore for the specified feature type.
StaticcreateCreates a WFSFeatureStore from a WFS server URL and feature type name.
This is the recommended way to create the store and is required to use WFS-T operations such as add, put, remove, lockFeatures, and queryWithLock.
The WFS server URL.
The name of the WFS feature type to load. Prefer the name without the prefix (places
rather than ns4:places): servers can generate prefixes that differ between WFS versions.
Optionaloptions: WFSFeatureStoreCreateOptions<TFeature> & WFSCapabilitiesFromUrlOptions
Options for fetching the capabilities and creating the store.
A WFSFeatureStore for the given parameters. The promise is rejected if store creation fails.
An event that is emitted when the contents of the store change. A store that performs create, update, or delete operations must report them with Store.emitStoreChangedEvent, to ensure that changes are communicated properly to listeners.
The "StoreChanged" event.
The callback to be invoked when the contents of the store change. The callback has three parameters:
Optionalcontext: any
An optional value used as the this context when executing the callback.
Optionaloptions: StoreChangedOptions
An optional object specifying additional options for the event listener. The inherited implementation ignores StoreChangedOptions.query: override this method to filter the events that this store reports. StoreChanged
Storeimplementation for querying an OGC WFS server and optionally inserting, updating, deleting, and locking features through WFS-T.This
Storeuses aCodecto convert the server response to LuciadRIA features. The default codec expects GeoJson format. Configure another codec to support a different format.Set this
Storeon a FeatureModel to create a feature model which retrieves data from a WFS server. Typically, you should use createFromURL or createFromCapabilities instead of calling the constructor directly.The following example creates a WFSFeatureStore for a given service URL and feature type:
The above example uses GeoJSON as the default exchange format. The following example shows how to configure the same
WFSFeatureStoreto decode GML-based data using aGMLCodec:If you want to access the WFS server capabilities and explore the service metadata and available data sets, you have to create a WFSCapabilities instance first. You can also use this instance to create a
Storeafterward:Supported versions
LuciadRIA supports querying WFS services using versions 1.0, 1.1, and 2.0 of the OGC WFS specification.Editing features (WFS-T)
add, put, remove, lockFeatures, and queryWithLock insert, update, delete, and lock features on servers that support WFS-T.These methods:
2.0.0and always sendversion="2.0.0"requests.