mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
feat: add mapped ALPR cameras with bounded source loading
Adapt the ALPR camera contribution to reusable layer components, retaining source attribution, bounded queries, selection and voice controls. Co-authored-by: Bilawal Sidhu <[email protected]>
This commit is contained in:
1 parent
ba7fda74d7
commit
4374c0fa60
28 files changed
+2358
-100
No files matched your search
@@ -177,6 +177,12 @@ const LAYER_ALIASES = new Map([
|
||||
['firms', 'local-firms'],
|
||||
['fires', 'local-firms'],
|
||||
['active fires', 'local-firms'],
|
||||
['alpr', 'alpr-cameras'],
|
||||
['alpr cameras', 'alpr-cameras'],
|
||||
['flock cameras', 'alpr-cameras'],
|
||||
['license plate readers', 'alpr-cameras'],
|
||||
['license plate cameras', 'alpr-cameras'],
|
||||
['plate readers', 'alpr-cameras'],
|
||||
]);
|
||||
|
||||
const CITY_ALIASES = new Map([
|
||||
|
||||
@@ -3140,3 +3140,27 @@ test('voice Radio: the keyless path applies no country filter the keyed path wou
|
||||
const testPlaceSearch = () => createStandalonePlaceSearch({ resolveApiKey: () => globalThis.window?.__GOOGLE_MAPS_API_KEY__ });
|
||||
function createGevActionRunner(options) { return createActionRunner({ placeSearch: testPlaceSearch(), ...options }); }
|
||||
function controlRadio(viewer, manager, args, options) { return runControlRadio(viewer, manager, args, { placeSearch: testPlaceSearch(), ...options }); }
|
||||
|
||||
test('ALPR common names toggle only the registered camera layer through the normal voice action', async () => {
|
||||
globalThis.window = globalThis.window || { clearTimeout, setTimeout, requestIdleCallback: null };
|
||||
const viewer = { clock: { onTick: { addEventListener: () => () => {} } },
|
||||
scene: { canvas: { addEventListener() {}, removeEventListener() {} } },
|
||||
camera: { moveEnd: { addEventListener() {} } } };
|
||||
const calls = [];
|
||||
let enabled = false;
|
||||
const dataManager = {
|
||||
layers: new Map([['alpr-cameras', { module: {} }]]),
|
||||
getAll: () => [{ id: 'alpr-cameras', name: 'ALPR Cameras' }],
|
||||
isEnabled: () => enabled,
|
||||
setEnabled: async (id, value) => { calls.push([id, value]); enabled = value; return true; },
|
||||
};
|
||||
const runner = createGevActionRunner({ viewer, styleManager: {}, dataManager });
|
||||
for (const alias of ['alpr-cameras', 'alpr', 'alpr cameras', 'flock cameras', 'license plate readers', 'license plate cameras', 'plate readers']) {
|
||||
for (const value of [true, false]) {
|
||||
const result = await runner('set_layer_visibility', { layerId: alias, enabled: value });
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.layerId, 'alpr-cameras');
|
||||
assert.deepEqual(calls.at(-1), ['alpr-cameras', value]);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user