The context menu control allows you to create a right-click menu to expose any custom functions.
var contextMenu = new ALKMaps.Control.ContextMenuFeature({
ctxMenuItems: [
{
separator: false, text: 'Remove Waypoint', onclick: function (e) {
removeWaypoint(contextMenu);
}
},
{ separator: true },
{ separator: false, text: 'Zoom In', onclick: function (e) { map.zoomIn(); } },
{ separator: true },
{ separator: false, text: 'Zoom Out', onclick: function (e) { map.zoomOut(); } }
]
}, {
filter: new ALKMaps.Filter.Comparison({
type: ALKMaps.Filter.Comparison.EQUAL_TO,
property: "isViaPoint",
value: true
})
});| 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 | |
| featureCallbacks | {Object} The functions that are sent to the feature handler for callback. |
| geometryTypes | {Array(String)} To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names. |
| rightClickedItem | |
| filter | |
| 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 ()