Creating a Custom Layer
  • 26 Jan 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Creating a Custom Layer

  • Dark
    Light
  • PDF

Article summary

Procedure

  1. In your project, create a file called SampleContextMenuEntryLayer.ts.

  2. Add a class that extends from the CustomLayer class by running:

    // SampleContextMenuEntryLayer.ts
    import {CustomLayer} from "@navvis/ivion";
    
    export class SampleContextMenuEntryLayer extends CustomLayer
    {
    }
  3. Override the onContextMenu() method so that the custom layer can provide a context menu entry to the user by running:

    // SampleContextMenuEntryLayer.ts
    import {
      ContextMenuEntryInterface, CustomLayer,
      MouseEventCoordinatesInterface
    } from "@navvis/ivion";
    
    export class SampleContextMenuEntryLayer extends CustomLayer
    {
      public onContextMenu(pos: MouseEventCoordinatesInterface): ContextMenuEntryInterface
      {
      }
    } 


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.