mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Draw Street Level's marker and cones through the renderer's draw port
The photo marker and every provider's image cones are icon sets on the draw port now, not billboard collections of their own. Each keeps its pick id as the item id, so clicks route as before; each set is drawn (empty) as soon as it is made, so the cones stay drawn over the marker whichever is first given something to show. The horizon cull still runs in the layer, against the ellipsoid lowered 1,000 m, and sends only the items whose show changed; a quiet first cull of items about to be drawn replaces the flags that held its callback back. marker and sequenceCones leave the Cesium allow-list. The Panoramax line click reads the camera height from the camera port. A difference the contract does not let us avoid: the icons turn to their bearing about local north (the contract's `course`), where the billboards used the Earth's axis. Looking straight down nothing changes; in a tilted view a cone now points along its true bearing on the ground instead of leaning toward the pole.
This commit is contained in:
1 parent
a10f3a16e1
commit
40ad27fb95
14 files changed
+432
-233
No files matched your search
@@ -224,8 +224,11 @@ export function createHorizonCull({ getViewer, items, onChange }) {
|
||||
let from = null;
|
||||
let stopListening = null;
|
||||
|
||||
/** Show what is in front of the horizon, hide the rest; the count seen. */
|
||||
function cull(list, position) {
|
||||
/**
|
||||
* Show what is in front of the horizon, hide the rest; the count seen.
|
||||
* `quiet`: `onChange` is not told (the caller draws them next anyway).
|
||||
*/
|
||||
function cull(list, position, quiet = false) {
|
||||
const horizon = horizonFrom(position, HORIZON_CULL_ELLIPSOID);
|
||||
let seen = 0;
|
||||
const changed = [];
|
||||
@@ -237,7 +240,7 @@ export function createHorizonCull({ getViewer, items, onChange }) {
|
||||
changed.push(item);
|
||||
}
|
||||
}
|
||||
if (changed.length) onChange?.(changed);
|
||||
if (changed.length && !quiet) onChange?.(changed);
|
||||
return seen;
|
||||
}
|
||||
|
||||
@@ -256,11 +259,15 @@ export function createHorizonCull({ getViewer, items, onChange }) {
|
||||
if (!cullAll(position)) stop();
|
||||
}
|
||||
|
||||
/** Cull `added` items (or all) now, then all again whenever the camera moves. */
|
||||
function update(added) {
|
||||
/**
|
||||
* Cull `added` items (or all) now, then all again whenever the camera
|
||||
* moves. `quiet`: this first cull of `added` does not call `onChange`,
|
||||
* for items about to be drawn with their `show`.
|
||||
*/
|
||||
function update(added, { quiet = false } = {}) {
|
||||
const viewer = getViewer();
|
||||
const position = eyeOf(viewer);
|
||||
if (position && !(added ? cull(added, position) : cullAll(position)))
|
||||
if (position && !(added ? cull(added, position, quiet) : cullAll(position)))
|
||||
return;
|
||||
stopListening ||=
|
||||
(viewer && findFrame(viewer)?.on('preRender', onPreRender)) || null;
|
||||
|
||||
Reference in new issue
Block a user