new cercalia.ContextMenu(opt_options)
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Extends
Methods
-
addOption(id, name, callback, opt_position)
src/cercalia/contextmenu.js, line 114 -
Add a new option in the context menu at the end or in a specific position. Returns options identifier. If the id options exist removes previous option.
Name Type Description id
string Option's identifier.
name
string Text will be displayed in option.
callback
function Function will be fired when users click the option.
position
number The position where option will be added.
-
addSubMenu(id, name, optionList)
src/cercalia/contextmenu.js, line 149 -
Name Type Description id
string Specify internal Id element
name
string Label of submenu.
optionList
cercalia.ContextMenuSubmenuOptionList Option list. Example:
{[{id:'btn1', label:'Button1', callback: 'callbackFn1'}, {id:'btn2', label:'Button2', callback: 'callbackFn1'}]}
. -
close()
src/cercalia/contextmenu.js, line 173 -
Close the menu.
-
closeSubmenu(id)
src/cercalia/contextmenu.js, line 278 -
Close Submenu
Name Type Description id
string Id.
-
existOption(id){boolean}
src/cercalia/contextmenu.js, line 184 -
Returns true if the option exists.
Name Type Description id
string Option's identifier.
Returns:
True if exists.
-
Returns:
Get Class name of object
-
Returns:
Unique Id.
-
hideOption(id)
src/cercalia/contextmenu.js, line 260 -
Hide menu option.
Name Type Description id
string Id.
-
isVisible(){boolean}
src/cercalia/contextmenu.js, line 101 -
Returns true if the context menu is visible.
Returns:
Returnstrue
if is visible.
-
open(coordinates, opt_projection)
src/cercalia/contextmenu.js, line 194 -
Open the menu. If menu isn't position fixed needs a position to be displayed.
Name Type Description coordinates
Array.<number> | cercalia.LonLat If menu isn't position fixed, menu will be displayed in ths position.
projection
string If menu isn't position fixed, and coordinates are Array of numbers, the projection will be necesary to transform the position.
-
openSubmenu(id)
src/cercalia/contextmenu.js, line 269 -
Open Submenu
Name Type Description id
string Id.
-
removeAllOptions()
src/cercalia/contextmenu.js, line 225 -
Remove all options in context menu.
-
removeOption(id)
src/cercalia/contextmenu.js, line 239 -
Remove an option from the context menu.
Name Type Description id
string Option's identifier.
-
showOption(id)
src/cercalia/contextmenu.js, line 251 -
Show menu option.
Name Type Description id
string Id.