Class: TableManager

Mapspace.control. TableManager


new TableManager( [options])

This control is an array of tabs with tables.

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

Table Manager options.

Source:
mapspace/controls/tablemanager.js
Fires:
  • Mapspace.control.event:TableManagerEvent
  • ol.Object.Event#event:change:enabled

Extends

Members


classNames :string|undefined

The class names to add to the default ones that the control will create.

Inherited From:
Overrides:
Source:
mapspace/controls/control.js

controldefs :Array.<Mapspace.ControlDefinition>

Array of control definitions this control contains.

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

<nullable> element :Element

This is the HTML element where the control is drawn. Do not modify this property directly. Use only in the constructor.

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

globalizationKey :string|undefined

This is the string that identifies in Mapspace.strings this control for globalization purposes.

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

<nullable> target :Element

This is the HTML element where the control is appended. Do not modify this property directly. Use constructor or setTarget to set this value.

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

Methods


addControlDefinition(controldef)

Adds a control definition to the control. By default the control in the control definition is changed its target to the element of this control. Override this behaviour in inherited classes to change the target to another one.

Parameters:
Name Type Description
controldef *

Control definition.

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

addControlDefinitions(controldefs)

Adds an array of control definitions to the control. Controls in the control definition array shouldn't have a target set.

Parameters:
Name Type Description
controldefs Array.<Mapspace.control.ControlDefinition>

Array of control definitions to add.

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

addTable(layer)

Add a new tab and shows the table of the given layer.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

clearControl()

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

Source:
mapspace/controls/tablemanager.js

containsControlDefinition(controldef)

Checks if a control definition is already added.

Parameters:
Name Type Description
controldef Mapspace.ControlDefinition

Control definition to check.

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

True if it is added.

Type
boolean

fade(fadeIn)

Fades this control in or out. This method ignores the fadeOut property of the control. You must care to check if this control can be faded or not checking that value and also if this control lies inside an active viewer.

Parameters:
Name Type Description
fadeIn boolean

If the control must fade in, otherwise it will fade out.

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

getControlDefinitions()

Return the array of control definitions this control has inside.

Inherited From:
Source:
mapspace/controls/control.js
Returns:
Type
Array.<Mapspace.ControlDefinition>

getCurrentLayer()

Gets the layer of the current table selected.

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

getCurrentTable()

Gets the current table selected.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
Mapspace.control.Table

getCurrentTableNumPages()

Get number of pages of the current table. Returns null if no table is currently available.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
number

getCurrentTablePageIndex()

Get the page index of the current table. Returns null if no table is currently available.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
number

getCurrentTableSettings()

Gets the current table settings. Returns empty array if no table is currently available.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
Array.<Mapspace.control.TableColumnsSettings>

getCurrentTableSize()

Gets the current table size, or number of rows that are visible. Returns -1 if all rows in the table are visible. Returns null if no table is currently available.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
number

getEnabled()

Return whether the control is currently enabled. When a control is not enabled can be clicked, cannot be dragged, but none of those interactions produce any event.

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

true if the control is enabled, false otherwise.

Type
boolean

getFadeInEnabled()

Returns if the control can be faded in. By default is true.

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

getFadeOutMode()

Returns the mode this control can be faded when it is in an active viewer. This value can be changed through the fadeOut option in the creation of the control. By default it is 'NEVER'. This default value can be overrided in derived classes.

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

getTab(item)

Return the tab object for the given layer.

Parameters:
Name Type Description
item Mapspace.layer.Vector | Mapspace.control.Table

Layer or table.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
Object

getTable(layer)

Return the table for the given layer.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
Mapspace.control.Table

getTables()

Returns the tables.

Source:
mapspace/controls/tablemanager.js
Returns:
Type
Array.<Mapspace.control.Table>

getTranslation(id)

Returns the translation for a given property ID. The Mapspace.strings object contains pairs of key and values. Each key follows the pattern: globalizationKey#propertyID.

Parameters:
Name Type Description
id string

The property ID.

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

The translation or undefined if not found.

Type
string | undefined

hasClassName(className)

Returns if the control has a class name

Parameters:
Name Type Description
className string

The class name.

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

isTool()

Returns true if this control is a tool. A tool is a control that contains one or several options in a list (for example a Mapspace.control.ViewerTools) that are linked to a viewer and only one of them can be active at a time. Tools are usually related to interactions in a way that only one interaction can be active at a time in a viewer.

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

moveTableLeft(layer)

Moves a table to the left.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

moveTableRight(layer)

Moves a table to the right.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

removeTable(layer)

Removes a layer from this control.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

render()

Renders the current table again.

Source:
mapspace/controls/tablemanager.js

setCurrentLayer(layer)

Set a layer as current selected. This unselects the rest of layers.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

setCurrentTablePageIndex(pageIndex)

Sets the page index of the current table. Call this has no effect if there is not a current table available.

Parameters:
Name Type Description
pageIndex number

Page index.

Source:
mapspace/controls/tablemanager.js

setCurrentTableSettings(settings)

Sets the current table settings.

Parameters:
Name Type Description
settings Array.<Mapspace.control.TableColumnsSettings>

Settings.

Source:
mapspace/controls/tablemanager.js

setCurrentTableSize(size)

Sets the current table size, or number of rows that are visible. Use -1 if all rows in the table must be visible. Call this has no effect if there is not a current table available.

Parameters:
Name Type Description
size number

NUmber of rows to be visible.

Source:
mapspace/controls/tablemanager.js

setEnabled(enabled)

Sets the control to enabled or not. When a control is not enabled can be clicked, cannot be dragged, but none of those interactions produce any event.

Parameters:
Name Type Description
enabled boolean

Enabled.

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

setFadeInEnabled(enabled)

Sets if the control can be faded in. By default is true.

Parameters:
Name Type Description
enabled boolean
Inherited From:
Source:
mapspace/controls/control.js

setTarget(target)

This function is used to set a target element for the control.

Parameters:
Name Type Description
target Element | string | Mapspace.Viewer

Target.

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

<abstract> unselectTool()

If this control is a tool the unselects the tool.

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

updateControl(element)

Updates the control.

Parameters:
Name Type Description
element HTMLElement

The element of the control.

Source:
mapspace/controls/tablemanager.js

<abstract> updateLanguage()

Updates the control for the current language in the Mapspace.Globalization singleton.

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

updateReport()

Updates the report control.

Source:
mapspace/controls/tablemanager.js

updateTable(layer)

Updates a table and show the given layer features as rows in the table.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

updateTableFilter(layer)

Updates a table to match the layer filter. This must be called only for local layers and not remote layers.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

updateTableIcon(layer)

Updates the icons that appear in tabs.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

Source:
mapspace/controls/tablemanager.js

updateTableSelection(layer, selected)

Updates a table to match the layer selection. This must be called any time the selection changes for a layer.

Parameters:
Name Type Description
layer Mapspace.layer.Vector

Layer.

selected Array.<ol.Feature>

Features selected.

Source:
mapspace/controls/tablemanager.js