new StyleCategorizedSelector( [options])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
Mapspace.control.ControlOptions |
<optional> |
Control options. |
- Source:
- mapspace/controls/stylecategorizedselector.js
Fires:
- 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:
- 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.stringsthis 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 controldefsArray.<Mapspace.control.ControlDefinition> Array of control definitions to add.
- Inherited From:
- Source:
- mapspace/controls/control.js
-
clearContent()
-
Clears the content of the control.
- Inherited From:
- Source:
- mapspace/controls/styleselector.js
-
clearControl()
-
Clears all the HTML elements under the control element and clear listeners.
- Inherited From:
- Source:
- mapspace/controls/stylecollectionselector.js
-
clearError()
-
Clears any error.
- Inherited From:
- Source:
- mapspace/controls/stylecollectionselector.js
-
containsControlDefinition(controldef)
-
Checks if a control definition is already added.
Parameters:
Name Type Description controldefMapspace.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
fadeOutproperty 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 fadeInboolean 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>
-
getDescription()
-
Returns a text to show to describe this selector.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- string
-
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:
trueif the control is enabled,falseotherwise.- Type
- boolean
-
getError()
-
Gets error.
- Inherited From:
- Source:
- mapspace/controls/stylecollectionselector.js
Returns:
- Type
- string
-
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
fadeOutoption 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:
-
getStyle()
-
Returns the selection made as a single style or a collection of styles.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- ol.style.Style | Mapspace.StyleCollection
-
getTranslation(id)
-
Returns the translation for a given property ID. The
Mapspace.stringsobject contains pairs of key and values. Each key follows the pattern: globalizationKey#propertyID.Parameters:
Name Type Description idstring The property ID.
- Inherited From:
- Source:
- mapspace/controls/control.js
Returns:
The translation or undefined if not found.
- Type
- string | undefined
-
getValue()
-
Returns a text to be used as value in the control that shows this selector.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- string
-
hasClassName(className)
-
Returns if the control has a class name
Parameters:
Name Type Description classNamestring The class name.
- Inherited From:
- Source:
- mapspace/controls/control.js
-
isErrorVisible()
-
True is error is visible.
- Inherited From:
- Source:
- mapspace/controls/stylecollectionselector.js
Returns:
- Type
- boolean
-
isForFeatures()
-
Returns true if the selector can define a style for an array of features.
- Inherited From:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- boolean
-
isForTileLayers()
-
Returns true if the selector can define a style for a
ol.layer.Tile.- Inherited From:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- boolean
-
isReady()
-
Returns if the selector is ready to get the style from it. Some selectors can be blocked until user executes some process in order to have a valid style ready to use.
- Inherited From:
- Source:
- mapspace/controls/styleselector.js
Returns:
- Type
- boolean
-
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
-
notifyProccessingStatusChanged()
-
Notifies that a long proccess has started or ended.
- Inherited From:
- Source:
- mapspace/controls/styleselector.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 enabledboolean 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 enabledboolean - 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 targetElement | string | Mapspace.Viewer Target.
- Inherited From:
- Source:
- mapspace/controls/control.js
-
showError(msg)
-
Shows an error.
Parameters:
Name Type Description msgstring Error message.
- Inherited From:
- Source:
- mapspace/controls/stylecollectionselector.js
-
<abstract> unselectTool()
-
If this control is a tool the unselects the tool.
- Inherited From:
- Source:
- mapspace/controls/control.js
-
updateContentForFeatures(features, layers, viewType)
-
Updates the content of the control to show the current style of the features. First attempt with features is to find a customStyle value in the feature as
feature.customStyle. Second attempt is to find the layer style of the layer each feature belongs to.Parameters:
Name Type Description featuresArray.<ol.Feature> An array of features that will be used to update current values in the control. If an array of more than one feature is passed then values that are different in them will be shown as a default one.
layersArray.<Mapspace.layer.Vector> The layers each feature in features array belongs to. Features and layers array must have the same length.
viewTypeMapspace.ViewType The type of viewer in which the style returned by this control will be used.
- Inherited From:
- Source:
- mapspace/controls/styleselector.js
-
updateControl(element)
-
Updates the control.
Parameters:
Name Type Description elementHTMLElement The element of the control.
- Inherited From:
- Overrides:
- Source:
- mapspace/controls/stylecollectionselector.js
-
<abstract> updateLanguage()
-
Updates the control for the current language in the Mapspace.Globalization singleton.
- Inherited From:
- Source:
- mapspace/controls/control.js