mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Draw Street Level, traffic and directions through one display each
- Street Level: coverage sequences are ground corridor sets of up to 120, draped on terrain and tiles as Cesium's ground polylines were; the marker and view cones are sprite movers turned to their compass bearing on screen and culled 1 km under WGS84. The layer no longer loads the Cesium SDK on Navara. - Traffic: vehicles are two point mover sets (an outline disc under each fill) scaled and faded with Cesium's NearFarScalar maths; congestion heat lines are ground corridor sets draped on tiles. Heights, depth, readiness and the surface key go through the engine, and Navara no longer loads the Cesium SDK for traffic. - Directions: the route is one ground corridor set in the annotation route's dash pattern, maneuvers are point movers and the A/B markers a disc and a letter sprite; the in-layer Navara branch and the Cesium point collection go. Known gaps against Cesium, to close in the contract: the traffic heat lines lose their glow and pulse and the route its flowing dashes (no animated ground fills yet), and dense Street Level coverage on Navara is costly as ground corridors (about 80 to 190 ms a frame at 6,000 to 14,400 sequences) until corridors are binned set-wide. Coupling: Navara renderer lines fall from 3349 to 2767, Cesium-importing files from 51 to 32, `viewer` lines from 1591 to 1373, Cesium SDK loads on Navara from 6 to 4.
This commit is contained in:
1 parent
2fbdca62be
commit
1559bd57f4
78 files changed
+4762
-3719
No files matched your search
@@ -1,14 +1,15 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import * as Cesium from 'cesium';
|
||||
import { createMapillaryProvider } from './index.js';
|
||||
import { mapillaryImageUrl } from './policy.js';
|
||||
import { sequenceIdFromPick } from '../../lineCoverage.js';
|
||||
import { thinImages } from '../../sequenceCones.js';
|
||||
import { validateProviders } from '../../registry.js';
|
||||
import {
|
||||
SACRAMENTO_VIEW,
|
||||
cameraEngine,
|
||||
fakeMapillarySource,
|
||||
rayCamera,
|
||||
streetLevelMap,
|
||||
} from '../../../../testSupport/streetLevelFakes.mjs';
|
||||
|
||||
function fakeContext(filter = { pano: 'all', sinceMs: null }) {
|
||||
@@ -83,49 +84,11 @@ test('cone thinning across the date line drops images metres apart', () => {
|
||||
);
|
||||
});
|
||||
|
||||
/** A viewer looking straight down on downtown Sacramento from 900 m. */
|
||||
function streetViewer() {
|
||||
const collection = () => ({
|
||||
add: (item) => item,
|
||||
remove: () => true,
|
||||
contains: () => false,
|
||||
get length() {
|
||||
return 0;
|
||||
},
|
||||
});
|
||||
const event = () => ({ addEventListener: () => () => {} });
|
||||
const camera = Object.assign(
|
||||
rayCamera({
|
||||
lon: -121.4944,
|
||||
lat: 38.5816,
|
||||
altitude: 900,
|
||||
pitch: -90,
|
||||
width: 100,
|
||||
height: 100,
|
||||
}),
|
||||
{ changed: event(), moveEnd: event() },
|
||||
);
|
||||
return {
|
||||
camera,
|
||||
scene: {
|
||||
canvas: { clientWidth: 100, clientHeight: 100 },
|
||||
globe: { show: false, ellipsoid: Cesium.Ellipsoid.WGS84 },
|
||||
primitives: collection(),
|
||||
groundPrimitives: collection(),
|
||||
preRender: event(),
|
||||
postRender: event(),
|
||||
requestRender() {},
|
||||
},
|
||||
};
|
||||
}
|
||||
/** The display looking straight down on downtown Sacramento from 900 m. */
|
||||
const streetMap = () =>
|
||||
streetLevelMap({ engine: cameraEngine(SACRAMENTO_VIEW) }).map;
|
||||
|
||||
test('coverage asks for no tiles before the key status is known, and none without a key', async (t) => {
|
||||
// Skip Cesium's one-time terrain table download for draped lines.
|
||||
t.mock.method(
|
||||
Cesium.GroundPolylinePrimitive,
|
||||
'initializeTerrainHeights',
|
||||
async () => {},
|
||||
);
|
||||
test('coverage asks for no tiles before the key status is known, and none without a key', async () => {
|
||||
for (const configured of [false, true]) {
|
||||
let answer;
|
||||
const tiles = [];
|
||||
@@ -138,10 +101,10 @@ test('coverage asks for no tiles before the key status is known, and none withou
|
||||
},
|
||||
});
|
||||
const instance = createMapillaryProvider({ source }).create(fakeContext());
|
||||
const viewer = streetViewer();
|
||||
instance.init(viewer);
|
||||
const map = streetMap();
|
||||
instance.init(map);
|
||||
const status = instance.status();
|
||||
instance.activate(viewer);
|
||||
instance.activate(map);
|
||||
assert.equal(tiles.length, 0, 'nothing before the status answers');
|
||||
answer({ configured });
|
||||
assert.deepEqual(await status, { configured });
|
||||
@@ -151,7 +114,7 @@ test('coverage asks for no tiles before the key status is known, and none withou
|
||||
assert.equal(tiles.length, 0, 'a key-less install never asks');
|
||||
assert.equal(instance.coverageStats().keyRequired, true);
|
||||
}
|
||||
instance.destroy(viewer);
|
||||
instance.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user