new Vector( [opt_options])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
opt_options |
Mapspace.nvdb.source.VectorOptions |
<optional> |
Options. |
- Source:
- mapspace-nvdb/source/vector.js
Extends
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
-
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
-
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
-
getServices()
-
Returns the reference to the
Mapspace.nvdb.Services
object that uses this source to make requests to the NVDB services.- Source:
- mapspace-nvdb/source/vector.js
Returns:
The services object.
-
loadAllFeatures(extent, projection, callback)
-
This is a 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.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.
- Overrides:
- Source:
- mapspace-nvdb/source/vector.js
-
loadFeatures(extent, resolution, projection, featureType, strategy, callback)
-
This is a overriden of the
ol.source.Vector#loadFeatures
method.The feature type here is ignored.
A callback is provided so when loading ends some extra actions can be taken, specially in viewers of type
Mapspace.threed.Viewer
.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-nvdb/source/vector.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:
- Overrides:
- 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