EMS.Control.ContextMenu

Replaces the browsers right click context menu with a custom version that can trigger map events.

Inherits from

Summary
EMS.Control.ContextMenuReplaces the browsers right click context menu with a custom version that can trigger map events.
Constructor
initialize

Constructor

initialize

Parameters

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();
Controls affect the display or behavior of the map.
Close