The context menu control allows you to create a right-click menu to expose any custom functions.
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:

| ALKMaps. | The 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 | |
| menuItems | Obsolete. |
| Constructor | |
| ALKMaps. | Create a new context menu control |
| Functions | |
| destroy | The destroy method is used to perform any clean up before the control is dereferenced. |
| activate | Activates the control. |
| deactivate | Deactivates the control. |
| setMap | Set the map property for the control, and register map events. |
| draw | The draw method is called when the control is ready to be displayed on the page. |
| showMenu | Displays the context menu at the specified location. |
| hideMenu | Hides the context menu. |
setMap: function ( map )
Set the map property for the control, and register map events.
| map | {ALKMaps.Map} |
The destroy method is used to perform any clean up before the control is dereferenced.
destroy: function ()
Activates the control.
activate: function ()
Deactivates the control.
deactivate: function ()
Set the map property for the control, and register map events.
setMap: function ( map )
The draw method is called when the control is ready to be displayed on the page.
draw: function()
Displays the context menu at the specified location.
showMenu: function( loc )
Hides the context menu.
hideMenu: function ()