@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
28 lines (27 loc) • 1.21 kB
TypeScript
import GirafeSingleton from '../../base/GirafeSingleton.js';
import Layer from '../../models/layers/layer.js';
/**
* Manages layers that hold user-derived data such as drawings or local files. Each type of user data layer is
* grouped under a theme layer in the layer tree.
* This manager provides functionality for adding, organizing, and toggling visibility of user data layers
* in the layer tree.
*/
export default class UserLayerManager extends GirafeSingleton {
private themeLayerItemIds;
private readonly userThemeConfig;
private get state();
private getThemeLayerByTreeId;
private getUserLayerByTreeId;
private getOrCreateThemeLayer;
private getThemeConfig;
/**
* Adds a user data layer to the layer tree. Each layer is added to the corresponding theme.
* If the theme layer does not exist yet, it is created according to a set of pre-defined configuration values.
*/
addUserLayerToTree(layer: Layer): void;
/**
* Removes a user data layer from the layer tree.
* If the associated theme layer becomes empty after the user layer is removed, the theme layer is also removed.
*/
removeUserLayerFromTree(layer: Layer): void;
}