Commit 485e80a
authored
feat(map): exclude plugin-internal style layers from the layer control (#1012)
* feat(map): exclude plugin-internal style layers from the layer control
Plugins can add native style layers as internal chrome (selection
footprints, draw/highlight helpers) that should not appear as individual
entries in the on-map Layer Control. Exclude style layers whose
metadata carries `geolibre:internal`, and refresh the layer control on
styledata (debounced) so the exclusion applies reactively when a plugin
adds or removes such layers.
* Address review feedback
- styledata listener: reset the timer on each event so it is a true
trailing-edge debounce instead of a leading-edge throttle, avoiding a
control rebuild against a half-built style mid-burst (Claude, CodeRabbit).
- destroy(): clear the pending layerControlStyleRefreshTimer so it cannot
fire after teardown or race a later init() (Claude).
- createLayerControlConfig: sort internalStyleLayerIds and dedupe the
merged excludeLayers via a Set so reordering an already-hidden internal
layer does not change the signature and force a rebuild (CodeRabbit).1 parent 68b04cf commit 485e80a
1 file changed
Lines changed: 47 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
350 | 371 | | |
351 | 372 | | |
352 | 373 | | |
| |||
664 | 685 | | |
665 | 686 | | |
666 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
667 | 692 | | |
668 | 693 | | |
669 | 694 | | |
| |||
1474 | 1499 | | |
1475 | 1500 | | |
1476 | 1501 | | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
1481 | 1524 | | |
1482 | 1525 | | |
1483 | 1526 | | |
| |||
0 commit comments