Merge origin/main into german/navara

Conflict resolutions:
- src/main.js: upstream's PHOTON_URL place-search setting is read once at
  module level and passed as geospatial: { endpoints: { photon } } by
  createApplication(), so every engine start of the switch flow gets it; the
  old single top-level createStandaloneApplication() call stays removed.
- src/layers/bikeshare/render/cesium/rendering.js: upstream's
  publishedCapacity fix applied with this branch's
  resolveCapacity(model, capacity, status) signature. The same fix is ported
  to src/layers/bikeshare/render/navara.js (record.publishedCapacity, status
  polls resolve from it), with a Navara regression test; upstream's
  proxyRoute test imports the moved render/cesium/rendering.js.
- src/layers/traffic/flow.js: upstream's nextTask() yield and current()
  check kept before the scene is taken from this branch's
  _trafficScene?.() ?? _viewer?.scene with its missing-scene return.
- scripts/package-boundaries.json, scripts/format-scope.json: union of both
  sides' file lists.
- src/voice/actionSchemas.test.mjs: both history comments kept, payload hash
  recomputed for the merged schemas (Sentinel-2 map stack enum plus the
  shorter layer alias hint).
- src/hudAltitudeDatum.test.mjs: this branch's engine-based IntelHUD
  construction with upstream's placeLabels summary context.
This commit is contained in:
German Khokhlov committed 2026-11-03 15:36:06 +04:00
commit 1a1eef0e5c
494 files changed
+28358 -1361

No files matched your search

+12 -4
View File
@@ -25,10 +25,18 @@ import { createReferenceSources } from '../sources/reference.js';
export { createReferenceSources as createStandaloneReferenceSources } from '../sources/reference.js';
/** Select standalone providers without starting their acquisition. */
export function createStandaloneLayerSources(overrides = {}) {
export function createStandaloneLayerSources(
overrides = {},
{ createMapTiles = createOpenFreeMapSource } = {},
) {
if (!overrides || typeof overrides !== 'object' || Array.isArray(overrides))
throw new TypeError('Source overrides must be an object');
const mapTiles = createOpenFreeMapSource();
const trafficTiles = createMapTiles({
selectDecoded: ({ roads }) => ({ roads }),
});
const installationTiles = createMapTiles({
selectDecoded: ({ military }) => ({ military }),
});
const defaults = {
...createReferenceSources(),
directions: createDirectionsSource(),
@@ -43,10 +51,10 @@ export function createStandaloneLayerSources(overrides = {}) {
}),
cctv: createCctvSource(),
radio: createRadioSource(),
traffic: createTrafficSource({ mapTiles }),
traffic: createTrafficSource({ mapTiles: trafficTiles }),
transit: createTransitSource(),
bikeshare: createBikeshareSource(),
installations: createInstallationSource({ mapTiles }),
installations: createInstallationSource({ mapTiles: installationTiles }),
satellites: createSatelliteSource(),
launches: createLaunchSource(),
alpr: createAlprTileSource(),
+51
View File
@@ -0,0 +1,51 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { createStandaloneLayerSources } from './layerSources.js';
test('traffic and installations own separate local OpenFreeMap lifetimes', () => {
const mapTiles = [];
const mapTileOptions = [];
const sources = createStandaloneLayerSources(
{},
{
createMapTiles(options) {
mapTileOptions.push(options);
const source = {
clears: 0,
clear() {
this.clears++;
},
getMetadata: async () => ({
template:
'https://tiles.openfreemap.org/planet/test/{z}/{x}/{y}.pbf',
}),
fetchBounds: async () => ({ tiles: [], loadedTiles: [] }),
};
mapTiles.push(source);
return source;
},
},
);
assert.equal(mapTiles.length, 2);
assert.notEqual(mapTiles[0], mapTiles[1]);
const decoded = { roads: ['road'], military: ['site'] };
assert.deepEqual(mapTileOptions[0].selectDecoded(decoded), {
roads: ['road'],
});
assert.deepEqual(mapTileOptions[1].selectDecoded(decoded), {
military: ['site'],
});
sources.traffic.resetFlowTileCache();
assert.deepEqual(
mapTiles.map((source) => source.clears),
[1, 0],
'traffic reset cannot clear installation work',
);
sources.installations.destroy();
assert.deepEqual(
mapTiles.map((source) => source.clears),
[1, 1],
'installation destroy cannot clear traffic work',
);
});