mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
refactor: separate map feature queries and source records
This commit is contained in:
1 parent
a8125ad917
commit
bf1d50f29b
28 files changed
+1128
-675
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import { normalizeMilitaryInstallations } from '../../data/militaryInstallationData.js';
|
||||
|
||||
export function createIngestion({
|
||||
state: layerState,
|
||||
services,
|
||||
@@ -58,19 +56,15 @@ export function createIngestion({
|
||||
// A SATURATED snapped tile was truncated upstream, so features from the
|
||||
// snap's extra ring may have crowded out sites actually on screen. Re-ask
|
||||
// for the exact viewport (separately keyed and cached) before rendering.
|
||||
let saturated = parts.model.installationResponseSaturated(payload);
|
||||
let saturated = payload.saturated === true;
|
||||
if (saturated) {
|
||||
payload = await fetchInstallations(true);
|
||||
saturated = parts.model.installationResponseSaturated(payload);
|
||||
saturated = payload.saturated === true;
|
||||
}
|
||||
const normalized = normalizeMilitaryInstallations(
|
||||
payload,
|
||||
payload.retrievedAt || new Date().toISOString(),
|
||||
);
|
||||
// The proxy answers a bbox at least as large as the viewport; keep only what
|
||||
// was actually asked for so nothing off-screen reaches the map or the
|
||||
// "current viewport only" context claim.
|
||||
const records = normalized.records.filter((record) =>
|
||||
const records = payload.records.filter((record) =>
|
||||
parts.model.installationWithinViewport(record, box),
|
||||
);
|
||||
let placesError = null;
|
||||
|
||||
Reference in new issue
Block a user