mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Draw FIRMS fire glows through the draw port and take the FIRMS renderer off the Cesium list
The fire glows are one draw-port icon set with horizon cull, drawn on the renderer's moving-icon path with a hold motion, as the layer's own icon primitive drew them. Only glows that are new or changed are written, after the set accepts them; fires a refresh drops are removed. Clicks read the renderer's hit and match the layer's own set id. The sprite order registers the set by its id.
This commit is contained in:
1 parent
3fa1ad0283
commit
b2502d6f37
11 files changed
+275
-118
No files matched your search
@@ -35,7 +35,7 @@ export function createSelection({
|
||||
const input = inputFor(layerState._viewer);
|
||||
layerState._clickSubscription = input.onClick((event) => {
|
||||
const picked = event.pick;
|
||||
const fire = pickedFire(picked);
|
||||
const fire = pickedFire(event.drawHit);
|
||||
if (fire) {
|
||||
selectAndFocusFire(fire);
|
||||
return;
|
||||
@@ -80,29 +80,17 @@ export function createSelection({
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a scene pick to one of this layer's fire records, or null.
|
||||
* Icon-set picks carry our row id on picked.id and on picked.primitive.id;
|
||||
* either is accepted.
|
||||
* @param {*} picked - Result of scene.pick().
|
||||
* Resolve a pick to one of this layer's fire records, or null: a hit (a
|
||||
* draw-port `Hit`, `event.drawHit`) on a glow of the layer's own icon set
|
||||
* whose id is a fire it draws now.
|
||||
* @param {?{set: string, id: string}} hit - The renderer's hit.
|
||||
* @returns {?Object} Fire record.
|
||||
*/
|
||||
|
||||
function pickedFire(picked) {
|
||||
if (!picked) return null;
|
||||
const primitiveId = picked.primitive?.id;
|
||||
if (
|
||||
typeof primitiveId === 'string' &&
|
||||
layerState._pickIndexById.has(primitiveId)
|
||||
) {
|
||||
return layerState._pickIndexById.get(primitiveId);
|
||||
}
|
||||
if (
|
||||
typeof picked.id === 'string' &&
|
||||
layerState._pickIndexById.has(picked.id)
|
||||
) {
|
||||
return layerState._pickIndexById.get(picked.id);
|
||||
}
|
||||
return null;
|
||||
function pickedFire(hit) {
|
||||
if (!hit || !layerState._icons || hit.set !== layerState._icons.id)
|
||||
return null;
|
||||
return layerState._pickIndexById.get(hit.id) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user