mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Read the wind layer's map-centre reading and its marker through the query and frame ports
The wind reading at the map centre now asks the renderer's query port where the ellipsoid lies under the middle of the canvas and converts it with the app's WGS84 helpers, instead of Cesium's camera pick and Cartographic. The inspection marker projects its point with the query port, hides it beyond the ellipsoid's horizon with isOccluded, and follows rendered frames through the frame port's postRender phase instead of the scene's event. The layer entry no longer carries a Cesium namespace: the rendering part, which stays Cesium-bound, defaults it, owns the fallback globe imagery host, and loads the adapter factories a viewer with no renderer bound gets its ports from. The wind entry, its inspection reading and its marker leave the allow-list. They still read the viewer's canvas size and container element.
This commit is contained in:
1 parent
f0e5540561
commit
03ff8f291f
9 files changed
+121
-121
No files matched your search
@@ -1,3 +1,9 @@
|
||||
import * as Cesium from 'cesium';
|
||||
// The renderer drapes through `findGlobe`, and the layer's inspection marker
|
||||
// reads `findQuery` and `findFrame`; a viewer with no renderer bound gets
|
||||
// those ports from the factories these modules provide.
|
||||
import '../../render/cesium/globe.js';
|
||||
import '../../render/cesium/camera.js';
|
||||
import {
|
||||
createShellSurface,
|
||||
WEATHER_SHELL_HEIGHTS,
|
||||
@@ -60,19 +66,22 @@ function sameWind(previous, next, previousField, nextField) {
|
||||
/** Globe-projected surface flow plus one owned, static colour field: globe
|
||||
* imagery on the globe host, a raised shell on the 3D Tiles host. */
|
||||
export function createWindRendering({
|
||||
cesium,
|
||||
cesium = Cesium,
|
||||
container,
|
||||
getViewer,
|
||||
getHost = () => ({
|
||||
collection:
|
||||
getViewer?.()?.imageryLayers ?? getViewer?.()?.scene?.imageryLayers,
|
||||
kind: 'globe',
|
||||
}),
|
||||
getHost: hostOf,
|
||||
eventTarget = globalThis.window,
|
||||
createGpuRendering = createWindGpuRendering,
|
||||
globeOf = findGlobe,
|
||||
onStatusChange,
|
||||
} = {}) {
|
||||
// The host the shell names, else the viewer's globe imagery.
|
||||
const getHost = () =>
|
||||
hostOf?.() ?? {
|
||||
collection:
|
||||
getViewer?.()?.imageryLayers ?? getViewer?.()?.scene?.imageryLayers,
|
||||
kind: 'globe',
|
||||
};
|
||||
let canvas = null;
|
||||
let context = null;
|
||||
let snapshot = null;
|
||||
|
||||
Reference in new issue
Block a user