new WFS( [opt_options])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
opt_options |
Mapspace.source.WFSOptions |
<optional> |
Options. |
- Source:
- mapspace/source/wfs.js
Extends
Members
-
lastRequestUnderLimit :boolean
-
- Source:
- mapspace/source/wfs.js
Methods
-
clear( [opt_fast])
-
Remove all features from the source.
Parameters:
Name Type Argument Description opt_fast
boolean <optional>
Skip dispatching events.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
clearExtent(extent)
-
Remove all extents cached that overlap the given extent. This is useful to allow for a later reloading of features in the given extent. If this function is not called it is not guaranteed that loading of features is done because it depends on the extents cached.
Parameters:
Name Type Description extent
Mapspace.Extent Extent.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
clearExtents()
-
Remove all extents cached. This is useful when it is wanted to force a new request no matter what previous extents have been done. For example, in 3D viewers.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
createReprojected(projection)
-
Returns a Promise that creates a new
Mapspace.source.Vector
but with the features reprojected to a new projection.Parameters:
Name Type Description projection
string | Mapspace.ProjectionInfo Projection for the resulting features.
- Inherited From:
- Source:
- mapspace/source/servervector.js
Returns:
A Promise that returns a
Mapspace.source.Vector
for the resolve function and an Error for the reject function.- Type
- Promise
-
getAttributes()
-
Returns a Promise that request all attribute names in the source.
- Source:
- mapspace/source/wfs.js
Returns:
A Promise that returns an array of attribute names for the resolve function or and error for the reject function.
- Type
- Promise
-
getDefaultUrlFunction(featureType)
-
Return the default UrlFunction.
Parameters:
Name Type Description featureType
string Type of feature to add to the request.
- Source:
- mapspace/source/wfs.js
Returns:
- Type
- function
-
getFeatureLoader(urlFunction, format, featureType, callback)
-
Returns the feature loader for the given urlFunction and format.
Parameters:
Name Type Description urlFunction
string | ol.FeatureUrlFunction Feature URL service.
format
ol.format.Feature Feature format.
featureType
string Feature type to use.
callback
function | undefined Function to call each time new features are loaded. It receives the number of features returned by the server. This is useful to know if the limit of the server has been reached or not. The usual limit is 5000 features max.
- Source:
- mapspace/source/wfs.js
Returns:
The feature loader.
- Type
- ol.FeatureLoader
-
getFeatureType(viewType, resolution)
-
Gets the best feature type to show for the given resolution.
Parameters:
Name Type Argument Description viewType
Mapspace.ViewType The type of viewer.
resolution
number <nullable>
Optional resolution. If no resolution is provided then the last feature type in the list returned by
getFeatureTypesForResolutions
is used.- Inherited From:
- Source:
- mapspace/source/servervector.js
Returns:
- Type
- string
-
getFeatureTypesForResolutions(viewType)
-
Gets the array of objects that define the feature types for different resolutions.
Parameters:
Name Type Description viewType
Mapspace.ViewType The type of viewer.
- Inherited From:
- Source:
- mapspace/source/servervector.js
Returns:
- Type
- Array.<Mapspace.FeatureTypeResolution> | undefined
-
getFixedAttributes()
-
Returns an array of reserved attribute names that are fixed and should not be modified in any feature editor.
- Source:
- mapspace/source/wfs.js
Returns:
- Type
- Array.<string>
-
getLoadingStrategy(viewType)
-
Gets the function that determines the strategy to load features.
A function that takes an
ol.Extent
and a resolution as arguments, and returns an array ofol.Extent
with the extents to load. Usually this is one of the standardol.loadingstrategy
strategies.Parameters:
Name Type Description viewType
Mapspace.ViewType The type of viewer.
- Inherited From:
- Source:
- mapspace/source/servervector.js
Returns:
- Type
- ol.LoadingStrategy | undefined
-
getVectorStatistics()
-
Returns the statistics for the vector features in the server. This information can later be used to create a report of features.
- Source:
- mapspace/source/wfs.js
Returns:
-
loadAllFeatures(extent, projection, callback)
-
This is a new method to load features that is only useful when this source is in a layer inside a
Mapspace.oblique.Viewer
orMapspace.street.Viewer
. so we can load all the needed features just in one call.A callback must be provided so when loading ends some extra actions can be taken.
Parameters:
Name Type Description extent
ol.Extent Extent.
projection
ol.proj.Projection Projection of the extent.
callback
function Function to call each time new features are loaded.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
loadFeatures(extent, resolution, projection, featureType, strategy, callback)
-
This is a overriden of the
ol.source.Vector#loadFeatures
method.Each feature type mantains a different Rtree for the extents. This way the source doesn't find an extent as already loaded when a different feature type has been requested.
The names of the feature types can be set using the featureTypes option in the constructor of this class.
An optional callback can be provided so when loading ends some extra actions can be taken.
Parameters:
Name Type Description extent
ol.Extent Extent.
resolution
number Resolution.
projection
ol.proj.Projection Projection of the extent.
featureType
string Feature type to use.
strategy
ol.LoadingStrategy Loading strategy to use.
callback
function | undefined Optional function to call each time new features are loaded.
- Overrides:
- Source:
- mapspace/source/wfs.js
-
notifyFeaturesChanged()
-
Triggers a FEATURESCHANGED event.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
resolutionToFeatureType(viewType, resolution)
-
Return the correct feature type name for a given resolution or null if feature types are not defined.
Parameters:
Name Type Description viewType
Mapspace.ViewType The type of viewer.
resolution
number Resolution.
- Inherited From:
- Source:
- mapspace/source/servervector.js
Returns:
Feature type name or null.
- Type
- string
-
setFeatureTypesForResolutions(viewTypes, value)
-
Sets the array of objects that define the feature types for different resolutions.
Parameters:
Name Type Description viewTypes
Mapspace.ViewType | Array.<Mapspace.ViewType> The types of viewer.
value
Array.<Mapspace.FeatureTypeResolution> | undefined - Inherited From:
- Source:
- mapspace/source/servervector.js
-
setFilter(filter, callback)
-
Sets the array of conditions for filtering features. As this is a time consuming operation, new filter should be compared with current to call only when the filter has changed. This function should not be called, and call
Mapspace.layer.Vector#setFilter
instead, that calls this function and also stores the filter.Parameters:
Name Type Argument Description filter
Mapspace.Filter The array of conditions that features must follow to be downloaded (if source is a
Mapspace.layer.ServerVector
) and/or rendered.callback
function <nullable>
An optional function to be called when the apply of the filter has finished.
- Inherited From:
- Source:
- mapspace/source/servervector.js
-
setLoadingStrategy(viewTypes, value)
-
Sets the function that determines the strategy to load features.
Parameters:
Name Type Description viewTypes
Mapspace.ViewType | Array.<Mapspace.ViewType> The types of viewer.
value
ol.LoadingStrategy | undefined - Inherited From:
- Source:
- mapspace/source/servervector.js