Class: CustomSwitcherControl

cercalia.Control.CustomSwitcherControl

Let you create a selector menu with a list of options, and assign a click event to each option
The options to be included by parameter are
Example:

    var option1 = {name:'opcio_1',className:'class1',clickFunction:function(){alert('1');}};
    var option2 = {name:'opcio_2',className:'class2',clickFunction:function(){alert('2');}};
 var customSwitcherControl = new cercalia.Control.CustomSwitcherControl({
     name : 'Switcher1',
     name : 'Custom selector menu',
     menuOptions : [option1,option2]
 });

new cercalia.Control.CustomSwitcherControl(option)

Name Type Description
option
Name Type Description
label string

Label to show on the map.

name string

Control name

menuOptions Array.<cercaliax.Control.CustomSwitcherControlOptions.MenuOption>

Objects array to specify the label, the style and the action list element.

Extends

Methods

Name Type Description
option Object

Option to add

position number | undefined optional

Position on list

Returns:
class

Obtain the control DOM element

Returns:
DOM Element

Returns the HTML element for every created menu.

Returns:
Returns the label name assigned to the control

Returns the control name

Returns:
Control name

Hide the control

Returns index of option.

Name Type Description
option Object

Option to check the index

Remove option by option

Name Type Description
options Object

Option to remove

Remove option with index

Name Type Description
index number

of option

Remove all options with the same name

Name Type Description
name string

Name of option

Shows the control