mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
feat(radio): render stations and clusters on Navara
Preserve native clustering, selection and direct-action playback through renderer ports. Record both-engine dev/preview, legacy, contract, shell and build evidence with remaining W2 limits.
This commit is contained in:
1 parent
d82a6f1550
commit
9d587c1d37
27 files changed
+1490
-350
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import * as geo from '../../geo/index.js';
|
||||
import { normalizeRadioCountryInput } from '../../data/radioCountry.js';
|
||||
|
||||
@@ -107,31 +106,13 @@ export function createQueries({ state: layerState, services, parts, source }) {
|
||||
}
|
||||
|
||||
function viewportRadioAnchor() {
|
||||
const camera = layerState._viewer?.camera;
|
||||
const scene = layerState._viewer?.scene;
|
||||
if (!camera) return null;
|
||||
const altitudeM = Number(camera.positionCartographic?.height);
|
||||
let cartographic = null;
|
||||
const canvas = scene?.canvas;
|
||||
if (canvas && typeof camera.pickEllipsoid === 'function') {
|
||||
const center = geo.cartesian2.create(
|
||||
canvas.clientWidth / 2,
|
||||
canvas.clientHeight / 2,
|
||||
);
|
||||
const position = camera.pickEllipsoid(
|
||||
center,
|
||||
scene.globe?.ellipsoid || Cesium.Ellipsoid.WGS84,
|
||||
);
|
||||
if (position) cartographic = geo.cartographic.fromCartesian(position);
|
||||
}
|
||||
cartographic ||= camera.positionCartographic || null;
|
||||
if (!cartographic) return null;
|
||||
return {
|
||||
lat: geo.math.toDegrees(cartographic.latitude),
|
||||
lon: geo.math.toDegrees(cartographic.longitude),
|
||||
altitudeM,
|
||||
globalView: parts.navigation.radioViewIsGlobal(altitudeM),
|
||||
};
|
||||
const anchor = parts.renderer?.viewportAnchor();
|
||||
return anchor
|
||||
? {
|
||||
...anchor,
|
||||
globalView: parts.navigation.radioViewIsGlobal(anchor.altitudeM),
|
||||
}
|
||||
: null;
|
||||
}
|
||||
|
||||
function rankedVisibleStations() {
|
||||
|
||||
Reference in new issue
Block a user