# XWUIGISLayerControl

Standalone map-layer picker for a host that is not `xwui-gis-map` - it works next to `xwui-map` or `xwui-gis-map` alike, since it only emits change events and never touches the map's own DOM.

Four independent groups, each optional: **basemap presets** (single-select), **analysis layers** (single-select, `none` means pins only), **pin-group filters** (multi-select visibility toggle over `hiddenPinGroups`), and **overlays** (multi-select, e.g. boundaries/roads/weather, tagged `overlay` or `reference` for the host to place in its own stack). `config.showLessCount` caps how many pin groups show before a "show more" toggle appears, and the whole panel can collapse to a compact strip via `data.compact` or user interaction (`collapsechange`).

The panel holds only UI-selection state; the actual layer data (tiles, pin coordinates) stays with whatever renders the map. A host wires one listener per group it cares about and applies the change itself.

## Basic Usage

```html
<xwui-gis-layer-control title="Layers"></xwui-gis-layer-control>
```

```js
control.setData({
  presets: [{ id: 'streets', label: 'Streets' }, { id: 'satellite', label: 'Satellite' }],
  activePreset: 'streets',
  pinGroups: [{ id: 'listings', label: 'Listings', color: '#4f46e5' }],
});
control.addEventListener('presetchange', (e) => map.setBasemap(e.detail.id));
control.addEventListener('pingroupchange', (e) => map.hideGroups(e.detail.hidden));
```

## Events

| Event | Detail | Fires when |
|---|---|---|
| `presetchange` | `{ id: string }` | A different basemap preset is picked. |
| `analysischange` | `{ id: string }` | A different analysis layer is picked (or `'none'`). |
| `pingroupchange` | `{ hidden: string[] }` | A pin group's visibility is toggled. |
| `overlaychange` | `{ ids: string[] }` | The set of active overlays changes. |
| `collapsechange` | `{ collapsed: boolean }` | The panel is collapsed or expanded. |

```api
```
