GMaps.js — Context menu

You can define a context menu (which will show on right click) with:

  control: 'map',
  options: [{
    title: 'Add marker',
    name: 'add_marker',
    action: function(e){
        lng: e.latLng.lng(),
        title: 'New marker'
  }, {
    title: 'Center here',
    name: 'center_here',
    action: function(e){
      this.setCenter(, e.latLng.lng());

You must define the control that the context menu is attached (map or marker) and an array of options with title, name and action Inside action you can use this for the GMaps.js object (map in this case) and MouseEvent object e.