ALKMaps.Control.ContextMenu

The context menu control allows you to create a right-click menu to expose any custom functions.

Example

new ALKMaps.Control.ContextMenu({
    'ctxMenuItems': [
        { separator: false, text: 'Zoom In', onclick: function(evt) { alert(evt); }},
        { separator: true },
        { separator: false, text: 'Zoom Out', onclick: function(evt) { alert(evt); }}
     ],
})

This will produce a menu like this:

Inherits from

Summary
ALKMaps.Control.ContextMenuThe context menu control allows you to create a right-click menu to expose any custom functions.
Properties
handleRightClicks{Boolean} Whether or not to handle right clicks.
autoActivate{Boolean} Activate the control when it is added to a map.
ctxMenuItems
menuItemsObsolete.
Constructor
ALKMaps.Control.ContextMenuCreate a new context menu control

Properties

handleRightClicks

{Boolean} Whether or not to handle right clicks.

autoActivate

{Boolean} Activate the control when it is added to a map.  Default is true.

ctxMenuItems

{Object}{ ‘ctxMenuItems’: [ { separator: false, text: ‘Zoom In’, onclick: function(ex) { alert(ex); }}, { separator: true }, { separator: false, text: ‘Zoom Out’, onclick: function(ex) { alert(ex); }} ] }

menuItems

Obsolete.  Backward compatible with old api.  {Object} - { ‘Zoom In’:’map.zoomIn()’, ‘Zoom Out’:’map.zoomOut()’, ‘separator’:true, ‘Zoom to Extent’:’map.zoomToMaxExtent()’ }

Constructor

ALKMaps.Control.ContextMenu

Create a new context menu control

Parameters

items{Object}
options{Object} An optional object whose properties will be set on the control
Controls affect the display or behavior of the map.
Close