The LayerFilterAPI is used to manage the visibility of layers and filter them.
These are additional metadata information from input data and are not always provided.
The LayerFilterAPI provides methods to:
Retrieve the list of available layer filters and their states.
Enable or disable specific layer filters.
Check if a specific node is part of an enabled layer filter.
This functionality is particularly useful for managing the visualization of complex models
by toggling the visibility of specific layer filters based on user preferences or application logic.
Quick Start
To use the LayerFilterAPI, layer filters can be accessed via the context:
// Get the webvis contextconstcontext = webvis.getContext();context.getRegisteredLayerFilters();// -> example: {DEFAULT: false, LAYER1: false}// Enable a layer filtercontext.setLayerFilterEnabled('LAYER1', true);// -> example: {layerFilterName: 'LAYER1', value: true, hasChanged: true}context.getEnabledLayerFilters();// -> example: ['LAYER1']context.getRegisteredLayerFilters();// -> example: {DEFAULT: false, LAYER1: true}// Check if a node is part of an enabled layerawaitcontext.isNodePartOfEnabledLayers(nodeID);// -> example: true
Events
The following events are associated with the LayerFilterAPI:
LayerFilterAPI
Overview
The LayerFilterAPI is used to manage the visibility of layers and filter them. These are additional metadata information from input data and are not always provided.
The LayerFilterAPI provides methods to:
This functionality is particularly useful for managing the visualization of complex models by toggling the visibility of specific layer filters based on user preferences or application logic.
Quick Start
To use the LayerFilterAPI, layer filters can be accessed via the context:
Events
The following events are associated with the LayerFilterAPI: