Draw imported files through the draw port, off Cesium

Import no longer loads KML, KMZ, GeoJSON and GPX through Cesium's data
source loaders. geoImportFeatures.js reads the sanitized file into plain
pins, lines, walls, polygons and ground overlays with the looks those
loaders gave them: icon, scale, colour, heading and hot spot, the shared
and inline style precedence, line and polygon colours and widths,
extruded and clamped geometry, rotated boxes and quads, and GeoJSON's
48 px pins, draped lines along rhumb lines and quarter-opacity fills.
geoImportPins.js draws them in three draw sets per file, places ground
pins through the height service (0 on the bare ellipsoid, whose coarse
tiles sag below it; the mesh nearby on photoreal maps), follows a
double-clicked pin, frames Fly-to, and shows, hides and removes them.

The Cesium adapter now draws two members the contract already had: an
icon's pixel offset and the wall shape. Image fills draw in the
translucent pass, so an overlay's own alpha blends as it did.

The Cesium allow-list is now empty; the ratchet test checks that its
scan still sees each way of reaching Cesium. The QA scripts read what a
file drew through the import's drawn(id), and the large-file check
compares it with Cesium's own reading of the same KML. A file the
renderer refuses to draw is refused by itself, without stopping its
batch. Two translations no longer used are dropped.
This commit is contained in:
Sameh Khamis committed 2026-11-09 15:50:53 -08:00
1 parent c073064507
commit 6c1f91014c
33 files changed
+2608 -1177

No files matched your search

+34
View File
@@ -255,6 +255,40 @@ test('only allow-listed files outside the Cesium adapter reach Cesium', () => {
);
});
test('the scan still recognises each way of reaching Cesium', () => {
// With the list empty, the check above passes vacuously unless the scan
// still sees Cesium; these are the forms the header lists.
const reaches = (code, file = 'src/x/y.js') => {
const { imports, takesNamespace } = scan(code);
return takesNamespace || imports.some((s) => reachesCesium(file, s));
};
for (const code of [
"import * as C from 'cesium';",
"import { Viewer } from '@cesium/engine';",
"import x from '../../node_modules/cesium/Source/Cesium.js';",
"import x from '/node_modules/cesium/index.js?v=1';",
"import { draw } from '../render/cesium/draw.js';",
"export * from '../render/cesium/draw.js';",
"const m = import('cesium');",
'function f(Cesium) {}',
'const { cesium } = deps;',
'const c = window.Cesium;',
'Cesium.Color.RED;',
])
assert.ok(reaches(code), code);
for (const code of [
"import { drawOf } from '../render/rendererOf.js';",
'const cesiumLike = 1; Cesium2.x;',
])
assert.ok(!reaches(code), code);
assert.ok(
vueScript(
'a.vue',
'<script src="../render/cesium/draw.js"></script>',
).external.some((s) => reachesCesium('src/ui/a.vue', s)),
);
});
test('every allow-listed file still reaches Cesium', () => {
const present = new Set(runtimeFiles);
const stale = allowList.filter(