Creating a Custom Layer
- 26 Jan 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Creating a Custom Layer
- Updated on 26 Jan 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Procedure
In your project, create a file called
SampleContextMenuEntryLayer.ts
.Add a class that extends from the CustomLayer class by running:
// SampleContextMenuEntryLayer.ts import {CustomLayer} from "@navvis/ivion"; export class SampleContextMenuEntryLayer extends CustomLayer { }
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?