mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Cable lines, landing pins, polygon fills, reference stems and reference points are now five draw sets per layer (submarine-cables:N:lines and so on) instead of GeoJSON data sources and entities. Clicks resolve through the draw hit; flights and the sweep's eye go through the camera port. The layer keeps the styling the GeoJSON loader gave it: cable colours, widths and alphas, simplestyle stroke, fill and marker properties, fills that keep the source's alpha, raised polygons at their heights, the default pin image, and features without a reference drawn but neither picked nor culled. Lines are densified along rhumb lines at the renderer's own granularity, so the draped geodesic arcs land on the same vertices the rhumb-line polylines did. Supporting pieces: - geo/rhumb, geo/horizon and geo/geodesic port the default renderer's rhumb line, ellipsoidal occluder and Vincenty inverse; the stub renderer now uses the shared horizon test and Vincenty inverse instead of its own copies. render/color gains cssColor, which reads CSS colours as the renderer does (hex, rgb, hsl; not named colours). - The Cesium draw port changes a line in place when only whether it shows changes (draped, on its ground primitive, waiting for it to be ready rather than restarting its build) or where an undraped line runs; anything else still rebuilds. Icon sets honour their blend. Ingestion, interaction, overlay, policy, rendering, state and surface no longer import Cesium and leave the allow-list. Pins are culled at the horizon each frame by the draw port instead of on the sweep, and marker-symbol glyphs are not drawn inside pins.
32 lines
974 B
JavaScript
32 lines
974 B
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { hexColor } from './color.js';
|
|
|
|
test('hex colours become renderer colours at the given alpha', () => {
|
|
assert.deepEqual(hexColor('#ff8000'), [1, 128 / 255, 0, 1]);
|
|
assert.deepEqual(hexColor('#000000', 0.25), [0, 0, 0, 0.25]);
|
|
});
|
|
|
|
test('CSS colours read as the default renderer reads them', async () => {
|
|
const Cesium = await import('cesium');
|
|
const { cssColor } = await import('./color.js');
|
|
for (const css of [
|
|
'#39d5ff',
|
|
' #8fffd2 ',
|
|
'#abc',
|
|
'#abcd',
|
|
'#11223344',
|
|
'rgb(10, 20, 30)',
|
|
'rgba(10,20,30,0.5)',
|
|
'rgb(10% 20% 30% / 0.25)',
|
|
'hsl(120, 50%, 25%)',
|
|
'hsla(300, 100%, 75%, 0.4)',
|
|
'hsl(30, 0%, 40%)',
|
|
]) {
|
|
const c = Cesium.Color.fromCssColorString(css);
|
|
assert.deepEqual(cssColor(css), [c.red, c.green, c.blue, c.alpha], css);
|
|
}
|
|
assert.equal(cssColor('not a colour'), null);
|
|
assert.equal(cssColor(undefined), null);
|
|
});
|