new Panel( [options])
This control allow to create and show lists of NVDB features to be changed, send them to NVDB services and check validity.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
options |
Mapspace.control.ControlOptions |
<optional> |
Panel options. |
- Source:
- mapspace-nvdb/control/panel.js
Fires:
- Mapspace.nvdb.control.event:PanelErrorEvent
- Mapspace.nvdb.control.event:PanelEvent
- Mapspace.control.event:ToolEvent
- ol.events.Event#event:outputprojectionchanged
- ol.events.Event#event:renamed
- ol.events.Event#event:saved
- ol.events.Event#event:unitschanged
- ol.events.Event#event:vieweractivated
- ol.events.Event#event:viewerdeactivated
- ol.events.Event#event:viewernamechanged
Extends
Members
-
statusTimer :Mapspace.time.Timer
-
Timer that trigger events at given duration to check status.
- Source:
- mapspace-nvdb/control/panel.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
-
checkConnection()
-
Returns a Promise that checks if a valid connection exists with NVDB services. The promise updates the control to show it as connected or not.
- Source:
- mapspace-nvdb/control/panel.js
Returns:
A Promise that never rejects and return true if connection is valid or false otherwise.
- Type
- Promise
-
clearControl()
-
Clears all the HTML elements under the control element and clear listeners.
- Source:
- mapspace-nvdb/control/panel.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
-
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
-
getChangesetSelected()
-
Gets the current changeset UUID that is selected or null if no one selected.
- Source:
- mapspace-nvdb/control/panel.js
Returns:
- Type
- string
-
getCurrentInteractiveTool()
-
Returns the current interactive tool selected in the control or null if none.
- Inherited From:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
-
getFilterOptions()
-
Returns the filter options.
- Source:
- mapspace-nvdb/control/panel.js
Returns:
-
getMessagesAsString()
-
Returns an string with the current NVDB messages for selected features. If no feature is selected returns an empty string.
- Source:
- mapspace-nvdb/control/panel.js
Returns:
- Type
- string
-
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 an array of the selected features.
- Source:
- mapspace-nvdb/control/panel.js
Returns:
- Type
- Array.<ol.Feature>
-
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:
-
getToolObjects()
-
Returns the array of objects that contain the tool buttons.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/toolscontrol.js
Returns:
- Type
- Array.<Mapspace.ToolDefinition>
-
getValidSelectedFeatures(typeIds, validation, opt_report)
-
Returns an array of valid features among selected features. Valid features are features with EDITING status (when not doing a validation), with original feature stored in cache if it is a modified feature, and with metadata info of the type of object.
Parameters:
Name Type Argument Description typeIds
Array.<number> An array in which store the different type ID found for the valid features.
validation
boolean If true the features returned are the ones for doing a validation. If false the features returned are the ones for sending them in a changeset.
opt_report
Mapspace.nvdb.Report <nullable>
An optional empty report object where store errors found when validating selected features
- Source:
- mapspace-nvdb/control/panel.js
Returns:
- Type
- Array.<ol.Feature>
-
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
-
resetStatus(features, uuid)
-
Resets status messages for the given features.
Parameters:
Name Type Argument Description features
Array.<ol.Feature> <nullable>
Optional array of features to which reset messages.
uuid
string <nullable>
Optional ID of the changeset the features belongs to.
- Source:
- mapspace-nvdb/control/panel.js
-
resetValidation(features)
-
Resets validation messages for the given features.
Parameters:
Name Type Argument Description features
Array.<ol.Feature> <nullable>
Optional array of features to which reset messages.
- Source:
- mapspace-nvdb/control/panel.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
-
sendFeatures(features, typeIds)
-
Sends an array of features, updating the listboxes that show status and errors. This function does not check the input, that should be done before.
Parameters:
Name Type Description features
Array.<ol.Feature> Features to validate.
typeIds
Array.<number> Type IDs of the features.
- Source:
- mapspace-nvdb/control/panel.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
-
setFilterOptions(filterOptions)
-
Sets the filter options.
Parameters:
Name Type Description filterOptions
Mapspace.nvdb.FilterModifiedOptions Filter options.
- Source:
- mapspace-nvdb/control/panel.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
-
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
-
startRefreshingStatus()
-
Starts refreshing of the status of any changeset that is processing.
- Source:
- mapspace-nvdb/control/panel.js
-
stopRefreshingStatus()
-
Stops refreshing of the status of any changeset that is processing.
- Source:
- mapspace-nvdb/control/panel.js
-
updateControl(element)
-
Updates the control.
Parameters:
Name Type Description element
HTMLElement The element of the control.
- Source:
- mapspace-nvdb/control/panel.js
-
validateFeatures(features, typeIds)
-
Validates an array of features, updating the listboxes that show status and errors. This function does not check the input, that should be done before.
Parameters:
Name Type Description features
Array.<ol.Feature> Features to validate.
typeIds
Array.<number> Type IDs of the features.
- Source:
- mapspace-nvdb/control/panel.js