feat(ferratas): keep loaded via ferratas in a tile cache on server and device, group segments, own look and count badge

This commit is contained in:
Maurice
2026-10-14 16:21:30 +02:00
parent a9882a6415
commit 160bc89e78
126 changed files with 5003 additions and 1153 deletions
@@ -1,23 +1,24 @@
import type { Map } from 'mapbox-gl';
import type { Ferrata } from '@trek/shared';
import type { FerrataGroup } from './ferrataGroups';
import { type FerrataSelectHandler, useFerrataLayerGL } from './useFerrataLayerGL';
/**
* The via ferrata layer as a mountable piece for a GL map view: it renders
* nothing itself, the lines live on `map`. See useFerrataLayerGL for the
* layering and the click handling.
* layering, the highlight and the click handling.
*/
export default function FerrataLayerGL({
map,
ferratas,
groups,
onSelect,
selectedId = null,
}: {
map: Map | null;
ferratas: readonly Ferrata[];
groups: readonly FerrataGroup[];
onSelect: FerrataSelectHandler;
selectedId?: string | null;
}) {
useFerrataLayerGL(map, ferratas, onSelect);
useFerrataLayerGL(map, groups, onSelect, selectedId);
return null;
}