Documentation Index

Fetch the complete documentation index at: https://knowledge.navvis.com/llms.txt

Use this file to discover all available pages before exploring further.

Adding Multiple Context Menu Entries

Prev Next

To include multiple entries, return an array of ContextMenuEntry objects and, if using TypeScript, set the return type to ContextMenuEntryInterface[] by running:

// SampleContextMenuEntryLayer.ts
// ...
  public onContextMenu(pos: MouseEventCoordinatesInterface): ContextMenuEntryInterface[]
  {
    //return the ContextMenuEntryInterface
    return [{
      name: "Go to Navvis",
      icon: "fa-globe",
      callback: () =>
      {
        window.open("https://www.navvis.com")
      }
    },
    {
      name: "Go to NavVis Developer Forum",
      icon: "fa-quote-left",
      callback: () =>
      {
        window.open("https://support.navvis.com/forums/")
      }
    }]
  }
// ...