mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
Traffic roads come from OpenFreeMap vector tiles, or TomTom flow tiles with a key (Hybrid by default). Military areas use OpenFreeMap polygons with a bundled worldwide name index; wide views show named points. ALPR reads an hourly OpenStreetMap extract. Cockpit place context and country, state and US county outlines use bundled Natural Earth and US Census data. Overpass is used only when an operator configures their own endpoint. Also: camera arrivals no longer land below ground, keyless terrain retries on 429, bounded relation geometry for configured Overpass, one shared OpenStreetMap credit, and separate tile and API transports for embedders. Co-authored-by: theGaryLarson <[email protected]> Co-authored-by: Milan Khanal <[email protected]>
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
import { requireFeatureSource } from '../sources/featureSource.js';
|
|
import { createOverpassFeatureSource } from '../sources/overpassFeatures.js';
|
|
import { createSurfaceServices } from './surfaceServices.js';
|
|
import { createAnnotationResolver } from '../annotations/resolver.js';
|
|
import { searchAndFlyTo } from '../locations.js';
|
|
|
|
/** Assemble application operations from the caller's request services. */
|
|
export function createApplicationOperations({ requests, signal, eventTarget }) {
|
|
for (const [name, method] of Object.entries({
|
|
terrain: 'getHeights',
|
|
regional: 'getBrief',
|
|
weather: 'getConditions',
|
|
summary: 'summarize',
|
|
})) {
|
|
if (typeof requests?.[name]?.[method] !== 'function')
|
|
throw new TypeError(`Missing application request service: ${name}`);
|
|
}
|
|
const features = requireFeatureSource(
|
|
requests.features ??
|
|
createOverpassFeatureSource({
|
|
boundarySource: requests.boundaries,
|
|
signal,
|
|
}),
|
|
);
|
|
const surface = createSurfaceServices({
|
|
terrainSource: requests.terrain,
|
|
signal,
|
|
eventTarget,
|
|
});
|
|
const annotationResolver = createAnnotationResolver({
|
|
featureSource: features,
|
|
signal,
|
|
});
|
|
return Object.freeze({
|
|
requests,
|
|
surface,
|
|
annotationResolver,
|
|
searchAndFlyTo: (viewer, query, options = {}) =>
|
|
searchAndFlyTo(viewer, query, {
|
|
...options,
|
|
features,
|
|
ground: surface.groundFloor,
|
|
signal:
|
|
signal && options.signal
|
|
? AbortSignal.any([signal, options.signal])
|
|
: signal || options.signal,
|
|
recoverNearView: annotationResolver.placesNearViewRecovery,
|
|
}),
|
|
});
|
|
}
|