Mixin: Menuable

Menuable

Mixin of the context menu methods.

Static Methods

  • (static) setMenu(options) [source]

  • Set a context menu
    foo.setMenu({
     'width'  : 160,
     'custom' : false,
     'items' : [
         //return false to prevent event propagation
        {'item': 'Query', 'click': function() {alert('Query Clicked!'); return false;}},
        '-',
        {'item': 'Edit', 'click': function() {alert('Edit Clicked!')}},
        {'item': 'About', 'click': function() {alert('About Clicked!')}}
       ]
    });
    Parameter Type Description
    options Object menu options
    Returns:
    *: this
  • (static) openMenu(coordinateopt) [source]

  • Open the context menu, default on the center of the geometry or map.
    Parameter Type Default Description
    coordinate opt Coordinate null coordinate to open the context menu
    Returns:
    *: this
  • (static) setMenuItems(items) [source]

  • Set menu items to the context menu
    Parameter Type Description
    items Array.<Object> menu items
    Returns:
    *: this
  • (static) getMenuItems() [source]

  • Get the context menu items
    Returns:
    Array.<Object>:
  • (static) closeMenu() [source]

  • Close the contexnt menu
    Returns:
    *: this
  • (static) removeMenu() [source]

  • Remove the context menu
    Returns:
    *: this