Class: FeaturePanel

FeaturePanel

An action for a Mapspace.control.FeaturePanel that edit features.


new FeaturePanel( [options])

Parameters:
Name Type Argument Description
options Mapspace.action.FeaturePanelOptions <optional>

Options.

Source:
mapspace-nvdb/actions/featurepanel.js

Extends

Members


<nullable> localStorageKey :string

This is a key that can be used to store content locally in the action.

Inherited From:
Source:
mapspace/actions/workspaceaction.js

<nullable> workspace :Mapspace.Workspace

This is the workspace this action will be tied to.

Inherited From:
Source:
mapspace/actions/workspaceaction.js

Methods


<protected> activateSnapping(snappingOptions)

Activates snapping in the viewer. This functionality for now only works for 2D viewers.

Parameters:
Name Type Description
snappingOptions Mapspace.SnappingOptions

Snapping options.

Inherited From:
Source:
mapspace/actions/featurepanel.js

saveFeatures(layer, features, action)

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 determined in each layer type.

Parameters:
Name Type Argument Description
layer Mapspace.layer.Vector

The layer.

features Array.<ol.Feature>

The array of features with changes.

action Mapspace.FeatureActionType <nullable>

An optional type of action performed in the features.

Inherited From:
Source:
mapspace/actions/featurepanel.js
Returns:

A Promise never rejects and returns an array with the features successfully saved for the resolve function.

Type
Promise

updateChildFeatures(layer, feature, oGeometry)

Returns a Promise that updates the geometries of all the child objects of the given feature using the snapping options in the layer. The feature must have a point geometry. If not the Promises resolves inmediatly.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

The layer that contains the feature and has the snapping options to use.

feature ol.Feature

The feature that has changed its geometry. This function do not checks if the feature has changed.

oGeometry ol.geom.Point

The original geometry.

Source:
mapspace-nvdb/actions/featurepanel.js
Returns:

A Promise that never rejects and return an array of updated features for the resolve function.

Type
Promise

useSavedFeatures(layer, features, action)

Executes final actions after successfully save some features.

Parameters:
Name Type Argument Description
layer Mapspace.layer.Vector

The layer.

features Array.<ol.Feature>

The array of features saved.

action Mapspace.FeatureActionType <nullable>

An optional type of action performed in the features.

Source:
mapspace-nvdb/actions/featurepanel.js