Specify multiple layers for operations
masterWhen using methods that act on layers (e.g., map.U.show(), map.U.hide(), map.U.toggle()), you can target one or many layers using one of the following four patterns:
- String: A single layer ID.
- Array of strings: Multiple specific layer IDs.
- Regular Expression: Matches layer IDs against a pattern.
- Filter Function: A function that receives a layer object and returns a truthy value to include it.
map.U.show('trees-label'); // String
map.U.show(['trees-label', 'trees-circle']); // Array
map.U.show(/^trees-/); // Regex
map.U.show(layer => layer.source === 'trees'); // Function