@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
23 lines (22 loc) • 1.09 kB
TypeScript
import BaseLayer from '../../../models/layers/baselayer';
/**
* Filters a tree structure of layers based on a search query.
* Updates the visibility of layers matching the search text.
*
* @param {BaseLayer[]} layerTree - The tree structure of layers to filter.
* @param {string} searchText - The text query used to filter the layers.
*/
export declare const filterLayerTree: (layerTree: BaseLayer[], searchText: string) => void;
/**
* Prepares a list of layer tree items for search by processing them hierarchically.
*
* @param {BaseLayer} layer - The layer to process.
* @param {string[]} [parentIds=[]] - An array of parent IDs representing the hierarchy above the current layer.
* @returns {{ idList: string[]; name: string }[]} An array of objects where each object contains:
* - `idList`: A combined array of parent IDs, the layer's own ID, and all of its children IDs.
* - `name`: The localized and lowercased name of the layer.
*/
export declare const prepareTreeItemForSearch: (layer: BaseLayer, parentIds?: string[]) => {
idList: string[];
name: string;
}[];