mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
DATA LAYERS keeps its curated core layers; regional and niche sources live in the Data Library, opened from Browse data library at the foot of the panel. Each entry is a JSON manifest in src/library/entries/ pointing at a live upstream (query API, provider-hosted file or tile endpoint), so nothing is bundled and a self-hosted instance hosts no data. Sources without CORS go through one allowlisted /api/library route. Kinds: dataset (GeoJSON, CSV, JSON records, ArcGIS, partitioned GeoParquet), tiles (XYZ, WMS/ArcGIS bbox export, terrarium relief) and pack. Selections persist and travel in share links as lib=, separate from the core layer tokens. Library rows get Zoom and Remove icon chips that work while the layer is off, rendered through RailChips. Strings are translated in every locale.
40 lines
1.3 KiB
Vue
40 lines
1.3 KiB
Vue
<script setup>
|
|
import UiButton from '../kit/UiButton.vue';
|
|
|
|
// Keyed chips shared by rail cards; the owner decides what a click does.
|
|
// An `icon` chip shows a Material Symbol (named in index.html's `icon_names`
|
|
// subset) with its label as the accessible name and tip; an `action` chip
|
|
// (Zoom, Remove) is a plain button, not an on/off toggle.
|
|
defineProps({
|
|
chips: { type: Array, default: () => [] },
|
|
onSelect: { type: Function, default: () => {} },
|
|
});
|
|
|
|
const chipClass = (chip) =>
|
|
`data-toggle-chip chip-${chip.state || (chip.active ? 'active' : 'idle')}${chip.icon ? ' chip-icon' : ''}`;
|
|
</script>
|
|
|
|
<template>
|
|
<UiButton
|
|
v-for="chip in chips"
|
|
:key="chip.id"
|
|
:data-chip-id="chip.id"
|
|
:class="chipClass(chip)"
|
|
:pressed="chip.action ? undefined : Boolean(chip.active)"
|
|
pressed-class="active"
|
|
:style="chip.color ? `--chip-color: ${chip.color}` : undefined"
|
|
:data-chip-color="chip.color || undefined"
|
|
:label="chip.icon ? chip.label : undefined"
|
|
:title="chip.title || (chip.icon ? chip.label : undefined)"
|
|
:disabled="Boolean(chip.disabled)"
|
|
:aria-busy="String(Boolean(chip.busy))"
|
|
@click="onSelect(chip)"
|
|
><span
|
|
v-if="chip.icon"
|
|
class="material-symbols-outlined"
|
|
aria-hidden="true"
|
|
>{{ chip.icon }}</span
|
|
><template v-else>{{ chip.label }}</template></UiButton
|
|
>
|
|
</template>
|