Replaces the browsers right click context menu with a custom version that can trigger map events.
| EMS. | Replaces the browsers right click context menu with a custom version that can trigger map events. |
| Constructor | |
| initialize |
| menuDisplayOwner {Object} | Scope of the hide and show menu fuctions |
| menuDisplayCallbacks {Object} | Contains the hide and show functions to be used as callbacks |
| options | {Object} |
To use the Context Menu Control create the control then add it to your map. You will also have to implement custom showMenu and hideMenu functions. Check out simple-test-page.html.
var menuCallbacks = {showMenu: this.showMenu, hideMenu: this.hideMenu};
var contextMenuControl = new EMS.Control.ContextMenu(this, menuCallbacks, []);
map.addControl( contextMenuControl );
contextMenuControl.activate();