mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 18:52:18 +00:00
Fix the review findings across the engines, layers, data and QA
Navara now matches Cesium where the review found it diverging: a flight holds the camera inputs, camera.changed counts turns as Cesium does, render requests made during a frame survive it, follow pinches zoom, ground widths follow the pixel ratio and Cyber sonar reaches glyph caches and models. On Cesium, a staged imagery swap keeps loading tiles, setView replaces a running flight, and a cleared weather detail goes away. The contract gains MoverSet.failed, maps.terrainRevision, render.maxTextureSize and surface.sampleTerrainMostDetailed on every engine, so layers retry failed models, key road heights by terrain, size weather textures to the GPU and place Bhote Koshi cards on detailed terrain. Engine switches keep the live view, follows, focus, layer options and cards: a pick hands over the exact pose, applies no address options and pans no carried-over card; a history visit still applies its entry. Layers put GhostMaps pins, cable landings, OSM Places and directions on the measured surface without per-frame sampling, draw the Cockpit contact dot, hide disabled CCTV on attach, and keep ALPR running outside secure contexts. KML imports draw raised polygon fills, rotated and coloured ground overlays and north-referenced icon headings, and report files with nothing to draw. QA scripts read the contract instead of Cesium internals (test:track is 109/109 again), wait for the camera to rest before clicking, and give cold switches and parked engines realistic time. Docs follow the code.
This commit is contained in:
1 parent
69fbf5b38d
commit
0ef29781e5
276 files changed
+7217
-1517
No files matched your search
@@ -13,9 +13,9 @@
|
||||
// - photoreal: Google 3D tiles with a browser key only (no server proxy),
|
||||
// with Google's logo and the tiles' own
|
||||
// copyright lines (creditLayerId) on screen. Showing them hides the base
|
||||
// imagery, as MapSourceController removes it; clearing them does not bring
|
||||
// it back until setBaseImagery. Hidden, not deleted: deleting the last
|
||||
// raster layer stops Navara 0.2.1 loading terrain at the current view.
|
||||
// imagery; clearing them restores the last base imagery and its credit.
|
||||
// Hidden, not deleted: deleting the last raster layer stops Navara 0.2.1
|
||||
// loading terrain at the current view.
|
||||
|
||||
import {
|
||||
SENTINEL2_CREDIT,
|
||||
@@ -124,6 +124,8 @@ export function createNavaraMaps(
|
||||
// call made last decides what shows.
|
||||
const generations = { display: 0, terrain: 0 };
|
||||
let destroyed = false;
|
||||
// maps.terrainRevision: one more for every terrain shown or cleared.
|
||||
let terrainRevision = 0;
|
||||
|
||||
function retire(slot) {
|
||||
if (!slot) return;
|
||||
@@ -137,6 +139,7 @@ export function createNavaraMaps(
|
||||
const slot = slots[name];
|
||||
slots[name] = null;
|
||||
retire(slot);
|
||||
if (name === 'terrain' && slot) terrainRevision++;
|
||||
}
|
||||
|
||||
// The new layer goes in before the old one goes: deleting the last raster
|
||||
@@ -150,6 +153,7 @@ export function createNavaraMaps(
|
||||
typeof credit === 'function' ? credit(layer) : credit,
|
||||
);
|
||||
retire(previous);
|
||||
if (name === 'terrain') terrainRevision++;
|
||||
if (shown.length) view.attribution?.add(shown);
|
||||
slots[name] = {
|
||||
key,
|
||||
@@ -204,6 +208,7 @@ export function createNavaraMaps(
|
||||
type: 'quantized-mesh',
|
||||
url: `${endpoint.url}{z}/{x}/{y}.terrain?v=1.2.0`,
|
||||
token: endpoint.accessToken,
|
||||
attributions: endpoint.attributions ?? [],
|
||||
};
|
||||
}
|
||||
default:
|
||||
@@ -249,7 +254,16 @@ export function createNavaraMaps(
|
||||
return;
|
||||
}
|
||||
if (slots.terrain?.key === description.url) return;
|
||||
show('terrain', description.url, description, { type: 'terrain' });
|
||||
const { attributions = [], ...sourceDesc } = description;
|
||||
show(
|
||||
'terrain',
|
||||
description.url,
|
||||
sourceDesc,
|
||||
{ type: 'terrain' },
|
||||
attributions.map(({ html }) => ({ attributionHtml: html })),
|
||||
);
|
||||
if (attributions.some(({ collapsible }) => collapsible === false))
|
||||
view.attribution?.show();
|
||||
},
|
||||
async setPhotorealTiles(source) {
|
||||
const generation = ++generations.display;
|
||||
@@ -329,10 +343,29 @@ export function createNavaraMaps(
|
||||
};
|
||||
},
|
||||
current: () => ({ baseImagery: currentBase, photoreal: tilesSource }),
|
||||
terrainRevision: () => terrainRevision,
|
||||
};
|
||||
|
||||
return {
|
||||
maps,
|
||||
/**
|
||||
* surface.sampleTerrainMostDetailed: the terrain shown sampled at its
|
||||
* finest level (Navara fetches the tiles); 0 on the ellipsoid.
|
||||
*/
|
||||
async sampleTerrain(positions) {
|
||||
const source = slots.terrain?.source;
|
||||
if (!source) return positions.map(() => 0);
|
||||
const sampled = await view.sampleTerrainMostDetailed(
|
||||
source,
|
||||
positions.map((place) => ({
|
||||
lat: (place.latitude * 180) / Math.PI,
|
||||
lng: (place.longitude * 180) / Math.PI,
|
||||
})),
|
||||
);
|
||||
return sampled.map(({ height }) =>
|
||||
Number.isFinite(height) ? height : undefined,
|
||||
);
|
||||
},
|
||||
destroy() {
|
||||
if (destroyed) return;
|
||||
destroyed = true;
|
||||
|
||||
Reference in new issue
Block a user