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 idstring Option's identifier.
namestring Text will be displayed in option.
callbackfunction Function will be fired when users click the option.
positionnumber The position where option will be added.
-
addSubMenu(id, name, optionList)
src/cercalia/contextmenu.js, line 149 -
Name Type Description idstring Specify internal Id element
namestring Label of submenu.
optionListcercalia.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 idstring Id.
-
existOption(id){boolean}
src/cercalia/contextmenu.js, line 184 -
Returns true if the option exists.
Name Type Description idstring 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 idstring Id.
-
isVisible(){boolean}
src/cercalia/contextmenu.js, line 101 -
Returns true if the context menu is visible.
Returns:
Returnstrueif 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 coordinatesArray.<number> | cercalia.LonLat If menu isn't position fixed, menu will be displayed in ths position.
projectionstring 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 idstring 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 idstring Option's identifier.
-
showOption(id)
src/cercalia/contextmenu.js, line 251 -
Show menu option.
Name Type Description idstring Id.