feat(shipwrecks): period picker like air accidents, sharper icons

- Replace the four era chips with the start and end year pickers the
  air-accidents layer uses (the same RowRange control, ported as is);
  the era colours stay as a legend under the row.
- Rasterize the boat marker at 144 px so large markers stay sharp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Itallo BrandãoandClaude Opus 5.5 committed 2026-11-05 04:49:36 -03:00
1 parent dcd0f2cccd
commit 112ffd4386
25 files changed
+439 -71

No files matched your search

+21 -2
View File
@@ -445,6 +445,8 @@ export class LayerPanel {
this._selectListItem(layerId, itemId, generation),
onSlider: (layerId, sliderId, value) =>
this._moveSlider(layerId, sliderId, value, generation),
onRange: (layerId, rangeId, end, value) =>
this._pickRangeEnd(layerId, rangeId, end, value, generation),
}),
id === null ? this._toggleContainer : this._groupContainers.get(id),
);
@@ -474,7 +476,7 @@ export class LayerPanel {
}
/**
* A layer's row chips, one-of-many switch, slider, color legend, info line
* A layer's row chips, one-of-many switch, slider, start/end pickers, color legend, info line
* and ordered list. The block
* is hidden while the layer is off (or while a dependency owner has
* surrendered it), so a quiet row stays quiet. Chips and list items are
@@ -501,6 +503,7 @@ export class LayerPanel {
const infoText = controls?.info ? String(controls.info) : '';
const segmented = controls?.segmented || null;
const slider = controls?.slider || null;
const range = controls?.range || null;
// The info line, once shown, stays in place and hides when empty.
if (infoText) row.info = true;
return {
@@ -509,10 +512,12 @@ export class LayerPanel {
legend.length === 0 &&
!infoText &&
!segmented &&
!slider,
!slider &&
!range,
chips,
segmented,
slider,
range,
legend,
info: row.info
? { text: infoText, title: controls?.infoTitle || '' }
@@ -577,6 +582,20 @@ export class LayerPanel {
this.setLayerParams(id, slider.params(value), { origin: 'user' });
}
_pickRangeEnd(id, rangeId, end, value, generation = this._generation) {
if (this._destroyed || this._generation !== generation) return;
const range = this._rowControlsFor(id)?.range;
if (
!range ||
range.id !== rangeId ||
(end !== 'from' && end !== 'to') ||
typeof range.params !== 'function' ||
!this.isEnabled(id)
)
return;
this.setLayerParams(id, range.params(end, value), { origin: 'user' });
}
_selectListItem(id, itemId, generation = this._generation) {
if (this._destroyed || this._generation !== generation) return;
const item = this._rowControlsFor(id)?.list?.items?.find(