<abstract> new ServerVector( [options])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
Mapspace.source.ServerVectorOptions |
<optional> |
Options. |
- Source:
- mapspace/source/servervector.js
Extends
- ol.source.Vector
Methods
-
<static> loadingstrategyNone(extent, resolution)
-
Strategy function for never loading features based on extent. This is useful for oblique viewers, where the moment to load features must be set manually and not automatically controled by extent changes.
Parameters:
Name Type Description extentol.Extent Extent.
resolutionnumber Resolution.
- Source:
- mapspace/source/servervector.js
Returns:
Returns an empty array.
- Type
- Array.<ol.Extent>
-
<static> loadingstrategyValid(extent, resolution)
-
Strategy function for only loading features that has a valid extent.
Parameters:
Name Type Description extentol.Extent Extent.
resolutionnumber Resolution.
- Source:
- mapspace/source/servervector.js
Returns:
Returns an empty array.
- Type
- Array.<ol.Extent>
-
<static> loadingstrategyValidAnResolution(extent, resolution)
-
Strategy function for only loading features that has a valid extent and resolution.
Parameters:
Name Type Description extentol.Extent Extent.
resolutionnumber Resolution.
- Source:
- mapspace/source/servervector.js
Returns:
Returns an empty array.
- Type
- Array.<ol.Extent>
-
clear( [opt_fast])
-
Remove all features from the source.
Parameters:
Name Type Argument Description opt_fastboolean <optional>
Skip dispatching events.
- 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 extentMapspace.Extent Extent.
- 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.
- Source:
- mapspace/source/servervector.js
-
createReprojected(projection)
-
Returns a Promise that creates a new
Mapspace.source.Vectorbut with the features reprojected to a new projection.Parameters:
Name Type Description projectionstring | Mapspace.ProjectionInfo Projection for the resulting features.
- Source:
- mapspace/source/servervector.js
Returns:
A Promise that returns a
Mapspace.source.Vectorfor the resolve function and an Error for the reject function.- Type
- Promise
-
getFeatureType(viewType, resolution)
-
Gets the best feature type to show for the given resolution.
Parameters:
Name Type Argument Description viewTypeMapspace.ViewType The type of viewer.
resolutionnumber <nullable>
Optional resolution. If no resolution is provided then the last feature type in the list returned by
getFeatureTypesForResolutionsis used.- 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 viewTypeMapspace.ViewType The type of viewer.
- Source:
- mapspace/source/servervector.js
Returns:
- Type
- Array.<Mapspace.FeatureTypeResolution> | undefined
-
getLoadingStrategy(viewType)
-
Gets the function that determines the strategy to load features.
A function that takes an
ol.Extentand a resolution as arguments, and returns an array ofol.Extentwith the extents to load. Usually this is one of the standardol.loadingstrategystrategies.Parameters:
Name Type Description viewTypeMapspace.ViewType The type of viewer.
- Source:
- mapspace/source/servervector.js
Returns:
- Type
- ol.LoadingStrategy | undefined
-
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.ViewerorMapspace.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 extentol.Extent Extent.
projectionol.proj.Projection Projection of the extent.
callbackfunction Function to call each time new features are loaded.
- Source:
- mapspace/source/servervector.js
-
loadFeatures(extent, resolution, projection, featureType, strategy, callback)
-
This is a overriden of the
ol.source.Vector#loadFeaturesmethod.If featureType is provided 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.
An optional callback can be provided so when loading ends some extra actions can be taken.
Parameters:
Name Type Argument Description extentol.Extent Extent.
resolutionnumber Resolution.
projectionol.proj.Projection Projection of the extent.
featureTypestring <nullable>
Optional feature type to use.
strategyol.LoadingStrategy <nullable>
Optional loading strategy to use.
callbackfunction | undefined Optional function to call each time new features are loaded.
- Source:
- mapspace/source/servervector.js
-
notifyFeaturesChanged()
-
Triggers a FEATURESCHANGED event.
- 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 viewTypeMapspace.ViewType The type of viewer.
resolutionnumber Resolution.
- 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 viewTypesMapspace.ViewType | Array.<Mapspace.ViewType> The types of viewer.
valueArray.<Mapspace.FeatureTypeResolution> | undefined - 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#setFilterinstead, that calls this function and also stores the filter.Parameters:
Name Type Argument Description filterMapspace.Filter The array of conditions that features must follow to be downloaded (if source is a
Mapspace.layer.ServerVector) and/or rendered.callbackfunction <nullable>
An optional function to be called when the apply of the filter has finished.
- Source:
- mapspace/source/servervector.js
-
setLoadingStrategy(viewTypes, value)
-
Sets the function that determines the strategy to load features.
Parameters:
Name Type Description viewTypesMapspace.ViewType | Array.<Mapspace.ViewType> The types of viewer.
valueol.LoadingStrategy | undefined - Source:
- mapspace/source/servervector.js