Class GSContextMenu
Extends GSAbstractMenu.
A menu control providing contextual actions when actuated by a right-click on the map.
Requires:
additional-ui module
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSContextMenu(options)
Constructs a new context menu
|
| Method Attributes | Method Name and Description |
|---|---|
|
hide()
Hides the context menu
|
|
|
remove()
Removes this context menu from the map instance it belongs to
|
|
|
show(position, target)
Shows the context menu
|
- Methods borrowed from class GSAbstractMenu:
- addItem, addItemAt, getItems, removeItem, removeItemAt, selectItem
- Events borrowed from class GSAbstractMenu:
- menuHidden, menuShown
Class Detail
GSContextMenu(options)
Constructs a new context menu
- Parameters:
- {Object} options Optional
- an object literal specifying the menu item options to set:
- {String} options.fontFamily
- a prioritized list of font family names and/or generic family names used to set the style of the menu item label text e.g. Lucida Grande,Helvetica,Sans-serif
- {String} options.fontSize
- sets the size of the menu item label text e.g. 12px
- {String} options.highlightColor
- the color of the text when the menu item is highlighted
- {String} options.highlightBackgroundColor
- the color of the menu item background when a menu item is highlighted
- {String} options.highlightBackgroundImage
- an image to display for the menu item background when a menu item is highlighted
Method Detail
hide()
Hides the context menu
remove()
Removes this context menu from the map instance it belongs to
show(position, target)
Shows the context menu
- Parameters:
- {GSPoint} position Optional
- the pixel offset relative to the top-left corner of the map viewport to position the context menu at. If not specified will show the context menu at its current position
- {mixed} target Optional
- the API component that triggered the show method on the context menu