refactor: export infrastructure layers with explicit application callbacks

This commit is contained in:
Sameh Khamis committed 2026-09-11 13:21:22 -07:00
1 parent e465197cee
commit 142bf583f8
10 files changed
+1338 -1115

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
import { createLocalGeoJsonLayer } from './localGeojsonCore.js';
// Resolved by Vite in builds and relative to this module in other consumers.
const datacentersUrl = new URL('./local_data/datacenters/datacenters.geojsonl', import.meta.url).href;
const damsUrl = new URL('./local_data/dams/dams.geojsonl', import.meta.url).href;
/**
* Create fresh datacenter and dam layers without starting or loading them.
* @param {object} services Caller-owned context, overlay and render operations.
* @returns {object[]} Datacenters then dams, with stable standalone identities.
*/
export function createInfrastructureLayers(services) {
const datacenters = createLocalGeoJsonLayer({
id: 'local-datacenters',
url: datacentersUrl,
name: 'Datacenters',
color: '#00ffff', // Cyan
icon: '▣',
source: 'Local',
labels: true,
labelMax: 700,
labelGridPx: 138,
}, services);
const dams = createLocalGeoJsonLayer({
id: 'local-dams',
url: damsUrl,
name: 'Dams',
color: '#0088ff', // Blue
icon: '▰',
source: 'USACE',
labels: true,
labelMax: 900,
labelGridPx: 132,
}, services);
return [datacenters, dams];
}