style: format the reusable infrastructure component

This commit is contained in:
Sameh Khamis committed 2026-09-11 16:07:53 -07:00
1 parent 04f4d54bfe
commit f70b5a3631
4 files changed
+671 -404

No files matched your search

+34 -24
View File
@@ -1,8 +1,12 @@
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;
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.
@@ -10,29 +14,35 @@ const damsUrl = new URL('./local_data/dams/dams.geojsonl', import.meta.url).href
* @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 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);
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];
}