mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
refactor: export infrastructure layers with explicit application callbacks
This commit is contained in:
1 parent
e465197cee
commit
142bf583f8
10 files changed
+1338
-1115
No files matched your search
@@ -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];
|
||||
}
|
||||
Reference in new issue
Block a user