Preserve source identity and history references through layer state

This commit is contained in:
Sameh Khamis committed 2026-09-13 09:06:13 -07:00
1 parent 80c5a09f15
commit 73135a7ae4
8 files changed
+92 -37

No files matched your search

+3
View File
@@ -54,6 +54,7 @@ export function createOpenSkySource({
now = () => Date.now(),
} = {}) {
return {
label: 'OpenSky Network',
async getSnapshot(query = {}, { signal } = {}) {
const params = new URLSearchParams();
if (Number.isFinite(query.latitude) && Number.isFinite(query.longitude)) {
@@ -111,6 +112,7 @@ export function createAdsbLolSource({
now = () => Date.now(),
} = {}) {
return {
label: 'adsb.lol',
async getSnapshot(_query = {}, { signal } = {}) {
const { response, payload } = await readResponse(
fetchImpl,
@@ -158,6 +160,7 @@ export function createAisStreamSource({
origin = () => globalThis.location?.origin || 'http://localhost',
} = {}) {
return {
label: 'AISStream',
async getSnapshot({ maxRows = 12000 } = {}, { signal } = {}) {
const url = new URL(apiUrl, origin());
url.searchParams.set('maxRows', String(maxRows));