mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Station dots and the selected-station highlight are now two point draw sets, picked through the draw hit, and the layer follows the camera through the camera port at its own threshold instead of the shared percentageChanged ledger. Altitude and view centre come from the camera pose and view rectangle. All five bikeshare files leave the Cesium allow-list. The Cesium draw port now keeps a rebuilt host in its place in the scene instead of re-adding it on top, tags hosts with their set id so sprite order can raise a draw set (registerSpriteSet), and restyles unclamped points in place when they have not moved, so a status poll or selection no longer rebuilds every station. Other draw-port layers (cyclone markers, earthquake discs) now also keep their first-build slot rather than jumping above the sprite layers on each rebuild.
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
export function createTesting({ state: layerState, services, parts, source }) {
|
|
/** Seed a selected-station runtime record while still exercising real select/clear paths. */
|
|
|
|
function _setBikeshareSelectionStateForTest({
|
|
viewer,
|
|
key,
|
|
record,
|
|
overlayHost,
|
|
}) {
|
|
layerState._viewer = viewer;
|
|
parts.rendering.attachSets(viewer);
|
|
layerState._stationRenderMap = new Map([[key, record]]);
|
|
layerState._selectedKey = null;
|
|
layerState._overlayHost = overlayHost || layerState.DEFAULT_OVERLAY_HOST;
|
|
}
|
|
|
|
/** Exercise the production selection path in focused runtime tests. */
|
|
|
|
function _selectBikeshareStationForTest(key) {
|
|
parts.selection._selectStation(key);
|
|
}
|
|
|
|
/** Exercise the production clear path and restore the production host seam. */
|
|
|
|
function _clearBikeshareSelectionForTest() {
|
|
parts.selection._clearSelection();
|
|
layerState._overlayHost = layerState.DEFAULT_OVERLAY_HOST;
|
|
}
|
|
return {
|
|
_setBikeshareSelectionStateForTest,
|
|
_selectBikeshareStationForTest,
|
|
_clearBikeshareSelectionForTest,
|
|
};
|
|
}
|