new Roads( [options])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
Mapspace.nvdb.layer.RoadsOptions |
<optional> |
Options. |
- Source:
- mapspace-nvdb/layer/roads.js
Fires:
- ol.render.event:Event
Extends
Methods
-
addFeatures(features, unselectable)
-
Add features to layer.
Parameters:
Name Type Argument Description featuresArray.<ol.Feature> Features.
unselectableboolean <nullable>
Optional boolean. If true features will be set as unselectable. By default is false.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
clearStyleCollectionCache()
-
Clear in the style cache any style from a Style Collection.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
confirmRemoval()
-
Returns true if the removal of features requires a confirmation through a browser confirm message. By default is true but inherited layers can override this behaviour.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
convertRuleToFilter(index)
-
Converts a
style ruleexisting in current style collection into aMapspace.Filter.Parameters:
Name Type Description indexnumber Rule index.
- Source:
- mapspace-nvdb/layer/roads.js
Returns:
- Type
- Mapspace.Filter
-
exportFeatures(options)
-
Returns a Promise that exports the exportable features of this layer to the given formats using the given filter.
Parameters:
Name Type Argument Description optionsMapspace.ExportOptions <nullable>
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns a boolean or a Blob for the resolve function or an Error for the reject function.
- Type
- Promise
-
filterEditableFeatures(features, includeRemoved)
-
Returns a new array of features filtering the ones that are editable from the passed ones.
Parameters:
Name Type Argument Description featuresArray.<ol.Feature> Features.
includeRemovedboolean <nullable>
If include features with 'blomaction' set to 'erasure'. By default is false.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<ol.Feature>
-
filterFeatures(selectedFeatures, filter)
-
Returns a Promise that filters features applying the given filter.
Parameters:
Name Type Description selectedFeaturesArray.<ol.Feature> Array of currently selected features in the layer.
filterMapspace.ExportFilterType The filter to apply to features.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an array of
ol.Featurefor the resolve function and an Error for the reject function.- Type
- Promise
-
findFeaturesByFilter(filter, resolution)
-
Finds the features that comply with the given filter.
Parameters:
Name Type Argument Description filterMapspace.Filter The filter.
resolutionnumber <nullable>
An optional resolution. If set then only features that are enabled to be selected are returned (features that return true for the isFeatureActionEnabled).
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<ol.Feature>
-
findFeaturesByText(text, resolution)
-
Finds the features that has any of the words in text in any of the observable values in the feature. Values in observable properties are converted to string and compared as strings. If value is an Object or an Array, then each owned property of the object, or any item in the array, is used for search.
Parameters:
Name Type Argument Description textstring A string with words, separated by blank spaces. Words can be any text, including an alphanumeric string, a number, or true/false.
resolutionnumber <nullable>
An optional resolution. If set then only features that are enabled to be selected are returned (features that return true for the isFeatureActionEnabled).
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<ol.Feature>
-
finishFeatureAction(actionType, feature, featureExtra, featureObject)
-
This function can be called after executing a given action to allow this layer to perform extra settings in the layer or feature. This function do not checks if the action is enabled for the given feature. Use
isFeatureActionEnabledpreviously for that.Parameters:
Name Type Argument Description actionTypeMapspace.FeatureActionType Type of action executed.
featureol.Feature <nullable>
An optional feature that has received the action, or null if the action affects all the layer.
featureExtraol.Feature <nullable>
An optional secondary feature to fullfil the action. Normally it is the original feature when the action is a reset.
featureObjectObject <nullable>
An optional object with a
dataandupdatekeys in which aMapspace.control.FeaturePanelstore extra data of a feature.- Inherited From:
- Source:
- mapspace/layer/vector.js
-
generateSelectionStyleFunction(baseStyles)
-
Creates a Function from a given
ol.style.Styleobject that is suitable as aol.StyleFunctionor as aol.FeatureStyleFunction. This Function will be used for features that are selected, and the one returned bygenerateStyleFunctionwill be used for features that are not selected.If the returned function is used as
ol.FeatureStyleFunctionthen thethiskeyword is expecetd to be the feature and two arguments are expected with the resolution and an optional viewType. The definition is like this:function(this:feature, number, ?Mapspace.ViewType): Array.<ol.style.Style>If the returned function is used as
ol.StyleFunctionthenthiskeyword is expected to be null and three arguments are expected: feature, resolution, and optional viewType. The definition is like this:function((ol.Feature|ol.render.Feature), number, ?Mapspace.ViewType): Array.<ol.style.Style>Parameters:
Name Type Description baseStylesArray.<ol.style.Style> | ol.style.Style The styles to use as reference to generate the selection style.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- function
-
generateStyleFunction(style)
-
Creates a Function that is suitable as a
ol.StyleFunctionor as aol.FeatureStyleFunction.If the returned function is used as
ol.FeatureStyleFunctionthen thethiskeyword is expected to be the feature and two arguments are expected with the resolution and an optional viewType. The definition is like this:function(this:feature, number, ?Mapspace.ViewType): Array.<ol.style.Style>If the returned function is used as
ol.StyleFunctionthenthiskeyword is expected to be null and three arguments are expected: feature, resolution, and optional viewType. The definition is like this:function((ol.Feature|ol.render.Feature), number, ?Mapspace.ViewType): Array.<ol.style.Style>If an optional
ol.style.Styleis passed then this style object will be used to create the output instead of Style cache of the layer.Parameters:
Name Type Argument Description styleol.style.Style <nullable>
An optional single style object to be used instead of the Style cache of the layer.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- function
-
getAllCount()
-
Returns a non-rejectable Promise that retrieves the number of features that are commonly reported in a
Mapspace.control.TableReport.- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an
Mapspace.LayerCountsfor the resolve function. This promise does not reject.- Type
- Promise
-
getAttributeAlias(attribute)
-
Returns an attribute alias for the given attribute.
Parameters:
Name Type Description attributestring Attribute.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- string
-
getAttributes()
-
Returns a Promise that request all attribute names in the layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an array of attribute names for the resolve function or and error for the reject function.
- Type
- Promise
-
getConditionListRender(filter, showLimits)
-
Returns the filter render for a a given filter or the current filter if none is provided.
Parameters:
Name Type Argument Description filterMapspace.Filter <nullable>
Filter.
showLimitsboolean <nullable>
If show limits in filter render or not. By default is true.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- string
-
getCustomFeatureEditor(options)
-
Returns the
Mapspace.control.FeatureEditorthat aMapspace.control.FeaturePanelmust use. This method can be overriden in derived classes.Parameters:
Name Type Description optionsMapspace.control.FeatureEditorOptions The required options.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
-
getCustomFilterEditor(options)
-
Returns the
Mapspace.control.FilterEditorthat this layer can use to filter the requested and/or rendered features.Parameters:
Name Type Description optionsMapspace.control.FilterEditorOptions The required options.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
-
getCustomStyle()
-
Returns the custom style of the layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- ol.style.Style
-
getCustomStyleCollection()
-
Returns the custom style collection of the layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
-
getDefaultCustomStyle()
-
Returns the default custom style to use in case the layer is initialized without one in the options. It can return null. If so, the layer will not have styles and will not be visible.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- ol.style.Style
-
getDefaultStyleCollections()
-
Returns an array of
Mapspace.StyleCollectionthat can be used with this layer.- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<Mapspace.StyleCollection>
-
getExpanded()
-
Returns a expanded property that is not serializable.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
getExportFilters()
-
Returns an array of
Mapspace.ExportFilterTypethat this layer can use when exporting features.- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<Mapspace.ExportFilterType>
-
getExportFormats()
-
Returns an array of
Mapspace.format.ExportFormatNamesthat this layer can be exported to.- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<Mapspace.format.ExportFormatNames>
-
getFeatureStyle(style, viewType)
-
Returns a
ol.style.Styleto be used in aol.Featurefor a given custom style.Features save custom styles in a
customStyleproperty that is serialized with workspace for certain layers. This custom style is aol.style.Stylebut is not suitable to be used as style for the feature. This function returns the correct Style to be used for the feature.Parameters:
Name Type Description styleol.style.Style The custom style of the feature.
viewTypeMapspace.ViewType Type of viewer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- ol.style.Style
-
getFeatureStyleInCollection(feature, viewType)
-
Returns the
ol.style.Stylefrom the current style collection to be used in aol.Feature. If no style collection is defined or must not be used returns null.Parameters:
Name Type Description featureol.Feature Feature.
viewTypeMapspace.ViewType Type of viewer that contains the feature.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- ol.style.Style
-
getFilter()
-
Returns the array of conditions in the filter of features. By default it is an empty array meaning that there is not any filter.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Mapspace.Filter
-
getFilteredCount()
-
Returns a Promise that retrieves the number of features that this layer can have if all features in the layer are loaded taking filters into account. This method returns a Promise so server vector layers can retrieve this info for the server.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns a number or null for the resolve function or an error for the reject function.
- Type
- Promise
-
getFilteredStyleRulesCount()
-
Returns a Promise that retrieves the number of features per each style rule that this layer can have if all features in the layer are loaded taking filters into account. This method returns a Promise so server vector layers can retrieve this info for the server.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an array of numbers for the resolve function or an error for the reject function.
- Type
- Promise
-
getFilterFunction()
-
Returns the filter function if there is a current filter.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- function | null
-
getFilterRender(filter, showLimits)
-
Returns a Promise that retrieves the filter render for a a given filter or the current filter if none is provided. Retrieves an empty string if no filter is set.
Parameters:
Name Type Argument Description filterMapspace.Filter <nullable>
Filter.
showLimitsboolean <nullable>
If show limits in filter render or not. By default is true.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns a string with the filter render and never rejects.
- Type
- Promise
-
getFixedAttributes(feature)
-
Returns an array of reserved attribute names that are fixed and should not be modified in any feature editor. Derived clases must return specific arrays.
Parameters:
Name Type Argument Description featureol.Feature <nullable>
An optional feature that will allow to determine extra attributes that should be considered fixed for it. If not provided then it is returned the default array of fixed attributes for all the features in the layer.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<string>
-
getIgnoreHoles(viewerType)
-
Gets the property that define if holes must be ignored when converting the geometries of this layer of 3D objects.
Parameters:
Name Type Description viewerTypeMapspace.ViewType Type of viewer for the material definition.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
getLayerCount()
-
Returns a Promise that retrieves the total number of features that this layer can have if all features in the layer are loaded without taking filters into account. This method returns a Promise so server vector layers can retrieve this info for the server.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns a number for the resolve function or an error for the reject function.
- Type
- Promise
-
getMaterialDefinition(viewerType, feature)
-
Returns the
Mapspace.MaterialDefinitionof the layer or of feature passed if one is passed. Returns null if the material definition is not in cache. Do no edit the returned object directly. Instead use thesetCustomStyleorsetCustomStyleCollectionfunctions. The MaterialDefinition should always derive from the style of the layer.Parameters:
Name Type Argument Description viewerTypeMapspace.ViewType Type of viewer for the material definition.
featureol.Feature <nullable>
Optional feature for which obtain the material definition. It is only used when a style collection is set and in use.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
-
getMeasureStyleRulesCount()
-
Returns a Promise that retrieves the measures of the features per each style rule that this layer can have if all features in the layer are loaded taking filters into account. This method returns a Promise so server vector layers can retrieve this info for the server.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an array of numbers for the resolve function or an error for the reject function.
- Type
- Promise
-
getOverviewSettings()
-
Returns the reference to the object that stores the overview settings. These settings are settings for showing this layer in an Overview panel, that show statistics and classification information. It is an object with two values: visible (if the layer must be visible), and group (a number or null) that groups layers. The reference can be modified
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Object
-
getPoint3DStyle(feature)
-
Gets the property that define how point geometries will be converted to 3D objects. If POINT then the point will be converted into a square facing always the camera (billboard). If POINT2D then will be converted to a given shape restricted to the XZ plane. Finally, if POINT3D then will be converted a proper 3D object. By default is POINT. This style only applies for Street viewers for now.
Parameters:
Name Type Argument Description featureol.Feature <nullable>
Optional feature for which obtain the point 3D style. It is only used when a style collection is set and in use.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
-
getPointHeight()
-
Returns the option that controls how points are positioned in height when using a single custom style.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
-
getPointSize(viewerType, feature)
-
Gets the size to use for point geometries when converting them into 3D objects. When styling with a
ol.style.Stylethe size of a point is given in pixels. This property sets the real world size to use instead of pixels. This value is ignored if point3DStyle is POINT. The value must be in the same units as the geometries of the layer. By default is 1.0 meters.Parameters:
Name Type Argument Description viewerTypeMapspace.ViewType Type of viewer for the material definition.
featureol.Feature <nullable>
Optional feature for which obtain the point size. It is only used when a style collection is set and in use.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- number
-
getRuleIndex(feature)
-
Returns the index of the style rule that matches the feature. Return -1 if there is not a custom style collection, or it is not in use, or feature matches no style rule.
Parameters:
Name Type Description featureol.Feature Feature.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- number
-
getRuleVisible(ruleIndex)
-
Gets the visibility of a given rule in the style collection, if one is set.
Parameters:
Name Type Description ruleIndexnumber Rule index.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
If visible or not. Null if no style collection is set.
- Type
- boolean
-
getSnappingOptions()
-
Returns the snapping options for this layer or null if the layer has no one.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
-
getStatisticsGroupsForRuleStyle(rule)
-
Returns an array of
Mapspace.layer.VectorValueGroupStatisticsthat matches the givenMapspace.StyleRuleor an empty array if there is no match. If layer has no custom style collection or vector statistics returns empty array.Parameters:
Name Type Description ruleMapspace.StyleRule Style rule.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- Array.<Mapspace.layer.VectorValueGroupStatistics>
-
getStyleCacheKey(viewType, ruleIndex, geomType)
-
Get the style cache key used with given params. Keys follow this pattern:
style-rule-{0}-{1}-{2}. For example:style-rule-1-ortho-Polygon.Parameters:
Name Type Argument Description viewTypeMapspace.ViewType Type of viewer.
ruleIndexnumber Index of the rule.
geomTypeol.geom.GeometryType <nullable>
Optional geometry type.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- string
-
getStyleCacheKeyForFeature(viewType, feature, useGeomType)
-
Gets the style cache key used for the given feature. Keys follow this pattern:
style-rule-{0}-{1}-{2}. For example:style-rule-1-ortho-Polygon. Returns null when passing a feature without geometry or that do not comply with any rule or comply with a non-visible rule.Parameters:
Name Type Argument Description viewTypeMapspace.ViewType Type of viewer.
featureol.Feature Feature.
useGeomTypeboolean <nullable>
Optional. If use geometry type in the key. Default is true.
string <nullable>
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
getStyleRulesCount()
-
Returns a Promise that retrieves the number of features per each style rule that this layer can have if all features in the layer are loaded without taking filters into account. This method returns a Promise so server vector layers can retrieve this info for the server.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns an array of numbers for the resolve function or an error for the reject function.
- Type
- Promise
-
getUseStyleCollection()
-
Returns if the custom style to use is the style collection. If false then the single custom style is used. By default is false. This value is set through
setCustomStyleandsetCustomStyleCollectionmethods.- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
hasFilterStatistics()
-
Returns true if this layer provides more statistics when using a filter. Only local layers created from local data have for now this ability.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
hasVectorStatistics()
-
Returns true if the source of this layer has statistics through a service that the source can use to retrieve it. These statistics can be used to present information about the number of objects and measures, total and by class if there is a classification.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
initializeStyleCache()
-
Initializes the style cache.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
-
isActionEnabled(actionType)
-
Returns true if the layer has the given action enabled. By default is true. The result can be overriden in derived classes for extra validation.
Parameters:
Name Type Description actionTypeMapspace.FeatureActionType The action to check.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
isCustomStyleEditable()
-
Returns true if the custom style of the layer can be edited. This function can be overriden in derived classes to avoid custom styles in certain layers where only one custom style is not suitable as styling setup.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
isDefaultCustomStyle(style)
-
Returns true if given style is the current default custom style.
Parameters:
Name Type Description styleol.style.Style - Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
isFeatureActionEnabled(actionType, feature, resolution, viewType)
-
Returns true if the given feature has the given action enabled for this layer. Do not checks that feature belongs to this layer, just check validity for the action in the feature. By default is true. The result can be overriden in derived classes for extra validation.
Parameters:
Name Type Argument Description actionTypeMapspace.FeatureActionType The action to check.
featureol.Feature The feature to check.
resolutionnumber <nullable>
An optional resolution to use in the checking.
viewTypeMapspace.ViewType <nullable>
An optional type of viewer.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
isReadOnly()
-
Returns true if the layer is read-only and cannot be edited in any way, either in geometries or attributes.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
isSavedInWorkspace()
-
Returns true if this layer can be saved in the workspace.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
- Type
- boolean
-
notifyFeaturesChanged()
-
Sends a notification of changes in features in the source of the layer, if it is required. By default this method does nothing. Override it in derived classes to execute a notification.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
notifyStatus(status)
-
Notifies a change in status.
Parameters:
Name Type Description statusMapspace.layer.VectorStatus - Inherited From:
- Source:
- mapspace/layer/vector.js
-
processFeature(action, feature)
-
Returns a Promise that processes a feature after a given action to allow this layer to perform extra settings in the layer or feature.
Parameters:
Name Type Argument Description actionMapspace.FeatureActionType Action executed.
featureol.Feature <nullable>
An optional feature that has received the action, or null if the action affects all the layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns the feature for the resolve function or and error for the reject function.
- Type
- Promise
-
processFeatures(action, features)
-
Returns a Promise that processes some features after a given action to allow this layer to perform extra settings in the layer or features.
Parameters:
Name Type Argument Description actionMapspace.FeatureActionType Action executed.
featuresArray.<ol.Feature> <nullable>
An optional array of features that has received the action, or null if the action affects all the layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that never rejects and that for the resolve function returns an array of features successfully processed or errors for the features with problems.
- Type
- Promise
-
removeFeatures(features)
-
Removes several features from the layer. Returns an array with the features finally removed.
Parameters:
Name Type Description featuresArray.<ol.Feature> The array of features to remove.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
The array of features finally removed.
- Type
- Array.<ol.Feature>
-
removeUnselectableFeatures()
-
Remove unselectable features from layer.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
saveFeature(feature, action, key)
-
Returns a Promise that saves a feature that has changed. The storage of the features can be in user local storage (cookies) or in a server database. That functionality is set in each layer type overriding this method.
Parameters:
Name Type Argument Description featureol.Feature The feature with changes.
actionMapspace.FeatureActionType <nullable>
An optional type of action performed in the feature.
keystring <nullable>
An optional key string that identifies a local storage for saving the feature.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that returns the feature for the resolve function or and error for the reject function.
- Type
- Promise
-
saveFeatures(features, action, key)
-
Returns a Promise that saves an array of features that has changed. The storage of the features can be in user local storage (cookies) or in a server database. That functionality is set in each layer type overriding this method.
Parameters:
Name Type Argument Description featuresArray.<ol.Feature> The array of features with changes.
actionMapspace.FeatureActionType <nullable>
An optional type of action performed in the features.
keystring <nullable>
An optional key string that identifies a local storage for saving the features.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
A Promise that never rejects and that for the resolve function returns an array of features successfully saved or errors for the features with problems.
- Type
- Promise
-
setCustomStyle(style)
-
Modifies the style of the layer using a
ol.style.Stylesingle objet that is used to generate a finalol.StyleFunctionto style the layer. Also updates the internal material definitions to use in Street and 3D viewers.Parameters:
Name Type Description styleol.style.Style The style object.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setCustomStyleCollection(styleCol)
-
Modifies the style of the layer using a
Mapspace.StyleCollectionsingle object that is used to generate a finalol.StyleFunctionto style the layer. Also updates the internal material definitions to use in Street and 3D viewers.Parameters:
Name Type Description styleColMapspace.StyleCollection Style collection object.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setDefaultMaterialDefinition(key)
-
Sets the material definition with its defaults values.
Parameters:
Name Type Description keystring Key. It is '_' for the material definition of the custom single style, and 'rule-{0}' for the material definitions of the custom collection style.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setExpanded(expanded)
-
Saves an expanded property that is not serialized.
Parameters:
Name Type Description expandedboolean If layer group is expanded or not.
- Inherited From:
- Source:
- mapspace/layer/vector.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 calls the source to update features as needed, and will cause a refresh in any viewer containing the layer.
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.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setIgnoreHoles(viewerType, ignore)
-
Sets the property that define if holes must be ignored when converting the geometries of this layer of 3D objects.
Parameters:
Name Type Description viewerTypeMapspace.ViewType Type of viewer for the material definition.
ignoreboolean True to ignore holes.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setMaterialDefinitions(key, style, point3DStyle, pointHeight)
-
Sets the material definitions for the given key using the given style.
Parameters:
Name Type Argument Description keystring Key. It is '_' for the material definition of the custom single style, and 'rule-{0}' for the material definitions of the custom collection style.
styleol.style.Style Style.
point3DStyleMapspace.Point3DStyle <nullable>
Optional point 3D style.
pointHeightMapspace.HeightReference <nullable>
Optional point height style.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setPoint3DStyle(point3DStyle)
-
Sets the property that define how point geometries will be converted to 3D objects. If POINT then the point will be converted into a square facing always the camera (billboard). If POINT2D then will be converted to a given shape restricted to the XZ plane. Finally, if POINT3D then will be converted a proper 3D object. By default is POINT. This style only applies for Street viewers for now.
Parameters:
Name Type Description point3DStyleMapspace.Point3DStyle The property.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setPointHeight(pointHeight)
-
Sets the option that controls how points are positioned in height when using a single custom style.
Parameters:
Name Type Description pointHeightMapspace.HeightReference The value.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setPointSize(viewerType, pointSize, ruleIndex)
-
Sets the size to use for point geometries when converting them into 3D objects. When styling with a
ol.style.Stylethe size of a point is giving in pixels. This property sets the real world size to use instead of that pixels. This value is ignored if point3DStyle is POINT. The value must be in the same units as the geometries of the layer. By default is 1.0 meters.Parameters:
Name Type Argument Description viewerTypeMapspace.ViewType Type of viewer for the material definition.
pointSizenumber The property.
ruleIndexnumber <nullable>
Optional index of the style rule in which apply the point size. If no rule index is passed, the value is set for the single style. If no style collection is set or is not in use then nothing is changed.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setRuleVisible(ruleIndex, visible)
-
Sets the visibility of a given rule in the style collection, if one is set.
Parameters:
Name Type Description ruleIndexnumber Rule index.
visibleboolean If visible or not.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
setSnappingOptions(options)
-
Sets the snapping options for this layer. It can be null to deactivate snapping options. This do not create any snapping interaction in the viewer. This function only stores the options to allow serialize it and be used by the pertinent
actionclasses.Parameters:
Name Type Argument Description optionsMapspace.SnappingOptions <nullable>
The snapping options.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
toggleRuleVisible(ruleIndex)
-
Toggles the visibility of a given rule in the style collection, if one is set.
Parameters:
Name Type Description ruleIndexnumber Rule index.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
updateFilterFunction()
-
Updates the filter function to use the current filter.
- Inherited From:
- Source:
- mapspace/layer/vector.js
-
updateStyleCache(style)
-
Updates the style cache using the given style.
Parameters:
Name Type Description styleol.style.Style | Mapspace.StyleCollection The style object.
- Inherited From:
- Overrides:
- Source:
- mapspace/layer/vector.js
-
writeFeatures(features, format, projection)
-
Returns a serialized string of the features in the given format.
Parameters:
Name Type Argument Description featuresArray.<features> The features to serialize.
formatMapspace.ExportFormatNames The format.
projectionstring <nullable>
Optional projection.
- Inherited From:
- Source:
- mapspace/layer/vector.js
Returns:
The serialized string or null if any problem happened.
- Type
- string