mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Move the session annotation board, Draw and Import out of the Cesium tools into sessionTools.js and give Navara its tools seam
This commit is contained in:
1 parent
dea10cac4f
commit
f5c14ec30d
7 files changed
+207
-102
No files matched your search
@@ -21,19 +21,25 @@ const tool = () => read('src/annotations/drawTool.js');
|
||||
|
||||
test('the application composition wires the draw tool and owns its teardown', () => {
|
||||
const tools = read('src/app/tools.js');
|
||||
const session = read('src/app/sessionTools.js');
|
||||
const engineAt = tools.indexOf('const annotations = sessionAnnotations({');
|
||||
const drawAt = tools.indexOf(
|
||||
"const drawTool = sessionTool(layerSession, 'draw', defer, () =>\n createSessionDrawTool({\n annotations,\n navigation: styleManager,\n publish: (view) => displayStore.publishDraw(view),",
|
||||
'const drawTool = sessionDrawTool({\n layerSession,\n annotations,',
|
||||
);
|
||||
assert.ok(engineAt >= 0, 'the session annotation board is missing');
|
||||
assert.ok(
|
||||
drawAt > engineAt,
|
||||
'the draw tool must follow the annotation board and receive it',
|
||||
);
|
||||
// The page session owns the tool; its rows answer through the store.
|
||||
assert.match(
|
||||
tools,
|
||||
session,
|
||||
/import \{ createSessionDrawTool \} from '\.\.\/annotations\/drawTool\.js';/,
|
||||
);
|
||||
assert.match(
|
||||
session,
|
||||
/sessionTool\(layerSession, 'draw', defer, \(\) =>\s*createSessionDrawTool\(\{\s*annotations,\s*navigation: styleManager,\s*publish: \(view\) => displayStore\.publishDraw\(view\),/,
|
||||
);
|
||||
// The tool holds a pointer claim, DOM listeners and a data source on the
|
||||
// viewer, so the viewer's attachment ends it — not whoever last pressed the
|
||||
// button; the session tool ends with the page.
|
||||
|
||||
Reference in new issue
Block a user