docs/api-reference/core/layer-manager.md
The
LayerManagerclass is gradually being refactor into aComponentManagerclass and will be made part of thelifecycledirectory. It is now an internal class, use theDeckclass (or theDeckGLReact Component) which creates aLayerManagerunder the hood.
The LayerManager class manages a set of layers' lifecycle.
For more information consult the Using Standalone article.
Creates a new LayerManager instance.
new LayerManager(gl, {eventManager: ...}})`
Parameters:
needsRedraw {#needsredraw}Checks if layers need to be redrawn.
layerManager.needsRedraw({clearRedrawFlags = false});
Parameters:
clearRedrawFlags (boolean) - Reset the needs redraw statusReturns:
true if redraw is needed.getLayers {#getlayers}Returns an list of layers, optionally be filtered by a list of layer ids.
const layers = layerManager.getLayers({layerIds = []});
Parameters:
layerIds (string[], optional) - A list of layer id strings. If supplied, the returned list will only contain layers whose id property matches (see note) one of the strings in the list.Returns:
Layer[] - array of layer instances.Notes:
setLayers {#setlayers}Provide a new list of layers. Layers will be matched against old layers, and any composite layers will be recursively expanded into primitive layers.
layerManager.updateLayers({newLayers});
newLayers (Layer[]) - Array of layersupdateLayers {#updatelayers}Updates the current list of layers.