mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep installation and local GeoJSON pick state off Cesium entities
Installation selection fills and outlines record the installation they
belong to in the layer's installationMarkers store instead of an
installationId expando, and the click handler resolves them from there.
Named-marker points keep their { installationId } pick payload, which is
the app's own object, so sibling layers treat a point click as before; the
marker remembers its record id for visit() instead of reading the point.
The local GeoJSON package tracks the entities each layer loaded in a
per-instance set instead of a __localLayerId tag, and passes the stem
base to registerEntityContext as targetPosition instead of hanging it on
the entity; FIRMS does the same, and voice targeting reads the context
record. QA scripts find a layer's features by their context id.
This commit is contained in:
1 parent
0889cd0cb7
commit
08985d5083
13 files changed
+58
-28
No files matched your search
@@ -21,6 +21,8 @@ import {
|
||||
getRenderGovernorDiagnostics,
|
||||
_resetRenderGovernorForTest,
|
||||
} from '../renderGovernor.js';
|
||||
import { getContextStore } from './contextStore.js';
|
||||
import { readEntityRecord } from './entityRecords.js';
|
||||
|
||||
/** The catalog's services, with the overlay host each test supplies. */
|
||||
const createLocalGeoJsonLayer = (options) =>
|
||||
@@ -486,7 +488,7 @@ for (const [heightM, minStemM, maxStemM] of [[500, 45, 90], [10000, 1100, 1400]]
|
||||
const env = await createRealLocalLayerHarness();
|
||||
t.after(() => { env.layer.destroy(env.viewer); env.cleanup(); });
|
||||
const entity = env.dataSources[0].entities.values[0];
|
||||
const carto = entity.__localBaseCarto;
|
||||
const carto = Cesium.Cartographic.fromCartesian(targetPositionOf(entity));
|
||||
env.viewer.camera.positionWC = Cesium.Cartesian3.fromRadians(carto.longitude, carto.latitude, heightM);
|
||||
env.preRender.raise(env.viewer.scene, Cesium.JulianDate.now());
|
||||
const positions = entity.polyline.positions.getValue(Cesium.JulianDate.now());
|
||||
@@ -894,10 +896,16 @@ function runArmedRetryChain(env, t, clock, cycles) {
|
||||
}
|
||||
}
|
||||
|
||||
/** The stem base an entity registered for voice targeting. */
|
||||
function targetPositionOf(entity) {
|
||||
const contextId = readEntityRecord(entity)?.contextId;
|
||||
return getContextStore().entities.get(contextId)?.targetPosition;
|
||||
}
|
||||
|
||||
/** Height of the (mutated-in-place) stem base — 0 until a sample lands. */
|
||||
function baseHeightM(env) {
|
||||
const entity = env.dataSources[0].entities.values[0];
|
||||
return Cesium.Cartographic.fromCartesian(entity.__localBaseCartesian).height;
|
||||
return Cesium.Cartographic.fromCartesian(targetPositionOf(entity)).height;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user