Class: FeaturePanel

Mapspace.control. FeaturePanel


new FeaturePanel( [options])

This control allow to show and edit attributes of selected features.

Parameters:
Name Type Argument Description
options Mapspace.control.ControlOptions <optional>

FeaturePanel options.

Source:
mapspace/controls/featurepanel.js
Fires:

Extends

Members


query :string|Mapspace.Filter

Last query in the 'Select by attributes' textbox.

Source:
mapspace/controls/featurepanel.js

Methods


addSection(element, name, key, text, classType, collapsed)

Adds a section button to the control.

Parameters:
Name Type Argument Description
element HTMLElement

Element in which inserting the section.

name string

Name for the section.

key string <nullable>

Globalization key. If not provided or not exist a value for it the default text will be used.

text string

Default text to show in case globalization key is null or not exist.

classType Object

Optional class type to use for creation of the element that must be returned.

collapsed boolean <nullable>

Optional boolean. If section must be created collapsed or not.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:

Element for inserting controls or control if classType param is passed.

Type
HTMLElement | Mapspace.control.Control

changeOutputProjection(transfFn, units)

Changes the output projection data to use in the panel when showing coordinates.

Parameters:
Name Type Description
transfFn ol.TransformFunction

The transformation function from EPSG:4326 default projection to output projection.

units ol.proj.Units

The units of the output projection.

Source:
mapspace/controls/featurepanel.js

clearControl()

Clears all the HTML elements under the control element and clear listeners.

Source:
mapspace/controls/featurepanel.js

clearFeature(feature)

Removes a feature from control data. This do not updates the control, updateFromData must be called after this.

Parameters:
Name Type Description
feature ol.Feature

Feature.

Source:
mapspace/controls/featurepanel.js

clearFeatures(layer)

Removes a layer from control data. This do not updates the control, updateFromData must be called after this.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer to remove.

Source:
mapspace/controls/featurepanel.js

containsInteractiveTool(tool)

Returns true if this control contains the given interactive tool.

Parameters:
Name Type Argument Description
tool Mapspace.InteractiveToolNames <nullable>

The tool name.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

copyToClipboard(content)

Copies a string to clipboard using an invisble span as a trick.

Parameters:
Name Type Description
content string

The content to copy to clipboard.

Source:
mapspace/controls/featurepanel.js

getButtonDisabled(name)

Gets if a button is disabled or not.

Parameters:
Name Type Description
name Mapspace.ToolNames

The name of the button.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

getButtonSelected(name)

Gets if a button is selected or not.

Parameters:
Name Type Description
name Mapspace.ToolNames

The name of the button.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

getButtonVisibility(name)

Gets the visibility of a button.

Parameters:
Name Type Description
name Mapspace.ToolNames

The name of the button.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

getCurrentData()

Returns a cloned object of the internal data object with all the information about changes in attributes.

Source:
mapspace/controls/featurepanel.js
Returns:

An object which keys are layer IDs and values are objects containing the needed information. Returns null if data was not initialized.

Type
Object.<string, Object>

getCurrentInteractiveTool()

Returns the current interactive tool selected in the control or null if none.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
Mapspace.InteractiveToolNames

getFeatures()

Returns the features in the control for the current selected layer. Returns an empty array if no layer is selected.

Source:
mapspace/controls/featurepanel.js
Returns:
Type
Array.<ol.Feature>

getFeaturesForLayer(layer)

Returns the feature in the control for the given layer. Returns an empty array if layer is not in the control.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/featurepanel.js
Returns:
Type
Array.<ol.Feature>

getSectionsUniqueNumber()

Returns a unique number (as string) to use in IDs inside sections, to avoid collisions between IDs. Each control deriving this class must implement its own method.

Inherited From:
Overrides:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
string

getSelectedFeatures()

Returns the selected features or empty array if no one is selected for the current selected layer.

Source:
mapspace/controls/featurepanel.js
Returns:
Type
Array.<ol.Feature>

getSelectedLayer()

Returns the selected layer in the control, if any.

Source:
mapspace/controls/featurepanel.js
Returns:
Type
Mapspace.layer.Vector

getSidePanel()

Returns the reference to the Side Panel this panel belongs to or null if no Side Panel is set.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
Mapspace.control.SidePanel

getToolObjects()

Returns the array of objects that contain the tool buttons.

Inherited From:
Overrides:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
Array.<Mapspace.ToolDefinition>

isOnlySelectedLayerChecked()

Returns true if the 'Select only in selected layer' checkbox is checked.

Source:
mapspace/controls/featurepanel.js
Returns:
Type
boolean

isSectionCollapsed(name)

Returns true if a section is collapsed.

Parameters:
Name Type Description
name string

Name of section.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

isSectionVisible(name)

Returns true if a section is visible.

Parameters:
Name Type Description
name string

Name of section.

Inherited From:
Source:
mapspace/controls/toolscontrol.js
Returns:
Type
boolean

notifyButtonClick(tool, interactive [, layer] [, features])

Notifies that a given tool has been selected.

Parameters:
Name Type Argument Description
tool Mapspace.ToolNames <nullable>

The tool selected or null if tool has been deselected.

interactive boolean

If the tool is interactive or not.

layer Mapspace.layer.Vector <optional>

An optional layer the selected tool must affect.

features Array.<ol.Feature> <optional>

An optional array of features the selected tool must affect.

Source:
mapspace/controls/featurepanel.js

notifyMarkedFeaturesChanged(layer, features)

Notifies that the marked features in the feature listbox has changed.

Parameters:
Name Type Argument Description
layer Mapspace.layer.Vector <nullable>

The layer.

features Array.<ol.Feature> <nullable>

the features marked.

Source:
mapspace/controls/featurepanel.js

notifySaving(layer, features, action, delay)

Save changed features and notifies that a saving operation has been taken.

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

The layer of the feature.

features Array.<ol.Feature>

Array of features that has changed.

action Mapspace.FeatureActionType

Type of change performed in the features.

delay number <nullable>

Optional delay in milliseconds to execute the saving and notification operation. This can be used in case of frequent and small changes when typing, snapping, etc.

Source:
mapspace/controls/featurepanel.js

resetFeature(feature)

Resets an existing visible feature in current feature editor without refreshing all. If feature is not currently in feature editor exits.

Parameters:
Name Type Description
feature ol.Feature

The feature.

Source:
mapspace/controls/featurepanel.js

selectFeatures(layer, features)

Sets the given features as selected.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

features Array.<ol.Feature>

Features.

Source:
mapspace/controls/featurepanel.js

selectInteractiveTool(tool)

Sets one interactive tool as selected. If tool passed is null then any interactive tool in the control is unselected. This function do not executes any related action due to tool selection, it just modifies the visual state of buttons.

Parameters:
Name Type Argument Description
tool Mapspace.InteractiveToolNames <nullable>

The tool name.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setAllButtonsVisibility(viewType)

Sets the visibility of buttons to the correct one for the given view type.

Parameters:
Name Type Description
viewType Mapspace.ViewType

The view type.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setButtonDisabled(name, disabled)

Sets if a button is disabled or not. This do not trigger any event, just modifies the visual state of the button.

Parameters:
Name Type Description
name Mapspace.ToolNames

The name of the button.

disabled boolean

If the button must be disabled or not.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setButtonSelected(name, selected)

Sets if a button is selected or not. This do not trigger any event, just modifies the visual state of the button.

Parameters:
Name Type Description
name Mapspace.ToolNames

The name of the button.

selected boolean

If the button must be selected or not.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setButtonsVisibility(names, visible)

Sets the visibility of a button or several buttons using its tools name.

Parameters:
Name Type Description
names Mapspace.ToolNames | Array.<Mapspace.ToolNames>

One or several names of the buttons to modify.

visible boolean

If the buttons must be visible or not.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setData(data)

Changes the data to be used by the control. This do not updates the control, updateFromData must be called after this.

Parameters:
Name Type Argument Description
data Object.<string, Object> <nullable>

The data.

Source:
mapspace/controls/featurepanel.js

setFeatures(layer, layerGroup, features, readOnly)

Sets the features of a given layer that must be visible in the FeaturePanel. If features array is undefined then all features in the layer will be set as visible in the FeaturePanel. Features that were previously visible and are no more in the features array are removed as visibles in the FeaturePanel. This do not updates the control, updateFromData method must be called for this.

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

Layer to add.

layerGroup ol.layer.Group <nullable>

Layer group the layer belongs to or null if layer is not in a layer group.

features Array.<ol.Feature> <nullable>

Optional features to add. If not provided, then all features in the layer will be added. If empty then the layer is removed from the list. Changes not saved will be lost in this case.

readOnly boolean <nullable>

If feature data is going to be editable or not. By default is false and it is editable.

Source:
mapspace/controls/featurepanel.js

setSectionCollapsed(name, collapsed)

Sets a section as collapsed or uncollapsed.

Parameters:
Name Type Description
name string

Name of the section.

collapsed boolean

True to collapse, false to uncollapse.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setSectionVisible(name, visible)

Sets a section visible or hidden.

Parameters:
Name Type Description
name string

Name of the section.

visible boolean

True to show, false to hide.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

setSelectedLayer(layer)

Sets the selected layer in the control to the given one, if that layer has been previously added. If the layer has no selected features then the layer could noyt be selected if other layers has a selection, so ensure the layer has selected features previously to call this function.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

The layer to select.

Source:
mapspace/controls/featurepanel.js

setSidePanel(panel)

Sets the reference to the Side Panel this panel belongs to. This do not re-targets the HTML element of the panel. Use setTarget for that.

Parameters:
Name Type Description
panel Mapspace.control.SidePanel

The Side panel reference.

Inherited From:
Source:
mapspace/controls/toolscontrol.js

showSelectedLayer()

Sets current selected layer in the control as visible, if any.

Source:
mapspace/controls/featurepanel.js

updateControl(element)

Updates the control.

Parameters:
Name Type Description
element HTMLElement

The element of the control.

Source:
mapspace/controls/featurepanel.js

updateFeatureCount(layer)

Updates the feature count of a layer.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

The layer.

Source:
mapspace/controls/featurepanel.js

updateFromData()

Updates this control from layer and feature data available.

Source:
mapspace/controls/featurepanel.js

updateInteractiveTools(tool)

Updates the control using the given interactive tool name. If it is not one interactive tool contained in the control then the control deselects the current interactive tool without triggering any event. If null deselects all.

Parameters:
Name Type Argument Description
tool Mapspace.InteractiveToolNames <nullable>

The name of an interactive tool.

Source:
mapspace/controls/featurepanel.js

updateLayerButtons()

Updates the buttons in the layer section.

Source:
mapspace/controls/featurepanel.js