mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
refactor(street-level): one provider, no orbit overview, no prewarm, simpler tile choice
The layer now owns its Mapillary parts directly: the provider registry,
pick router, multi-provider UI summary, params codec helper and provider
context are gone. createStreetLevelLayer({ source }) builds coverage,
sequences, the nearest-image lookup and the MapillaryJS viewer itself; a
single providerOn switch keeps the share link's `mapillary` option (off
draws nothing), and getParams/setParams keep { mapillary, pano, sinceDays }.
No z0-5 overview points: above 60 km nothing is drawn and the panel says to
zoom in; the proxy now serves only coverage z11-14. Tiles come from the
visible ground within range of the camera, ranked from the ground under it
(no line-of-sight ranking or near-range padding). MapillaryJS loads on the
first photo; viewer prewarm is removed. Key status, a rejected key and a
rate limit share one `blocked` state on coverage.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0f41fb04cd
commit
37a96072fa
51 files changed
+1240
-2659
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { imageConeGlyph } from '../../glyphs.js';
|
||||
import { passesImageryFilter } from '../../filter.js';
|
||||
import { passesImageryFilter, resolveFilter } from '../../filter.js';
|
||||
import { createHorizonCull, metresBetween } from '../../view.js';
|
||||
import {
|
||||
COLORS,
|
||||
@@ -53,7 +53,12 @@ export function createSequences({ state, source, parts }) {
|
||||
}
|
||||
|
||||
function notify() {
|
||||
state.context.notify();
|
||||
state.notify?.();
|
||||
}
|
||||
|
||||
/** Show a sequence error, or withdraw it (null); see `reportSequenceError`. */
|
||||
function reportError(message) {
|
||||
parts.reportSequenceError?.(message);
|
||||
}
|
||||
|
||||
/** Drawn cone billboards. */
|
||||
@@ -95,7 +100,7 @@ export function createSequences({ state, source, parts }) {
|
||||
pano: true,
|
||||
});
|
||||
// Resolved now, so a "since N days" window keeps up with the clock.
|
||||
const filter = state.context.getFilter();
|
||||
const filter = resolveFilter(state.filter);
|
||||
for (const image of images) {
|
||||
if (!passesImageryFilter(image, filter)) continue;
|
||||
const billboard = collection.add({
|
||||
@@ -146,7 +151,7 @@ export function createSequences({ state, source, parts }) {
|
||||
state.sequence.loading = false;
|
||||
state.sequence.images = cached;
|
||||
renderCones(cached);
|
||||
state.context.actions.reportError(null);
|
||||
reportError(null);
|
||||
notify();
|
||||
return;
|
||||
}
|
||||
@@ -172,15 +177,13 @@ export function createSequences({ state, source, parts }) {
|
||||
remember(sequenceId, images);
|
||||
state.sequence.images = images;
|
||||
renderCones(images);
|
||||
state.context.actions.reportError(null);
|
||||
reportError(null);
|
||||
} catch (error) {
|
||||
if (!controller.signal.aborted) {
|
||||
// Nothing to show: drop the highlight, so a click asks again.
|
||||
parts.coverage.recolorSequence(sequenceId, false);
|
||||
state.sequence.selectedId = null;
|
||||
state.context.actions.reportError(
|
||||
error?.message || 'Sequence images unavailable',
|
||||
);
|
||||
reportError(error?.message || 'Sequence images unavailable');
|
||||
}
|
||||
} finally {
|
||||
if (state.sequence.abort === controller) {
|
||||
@@ -200,7 +203,7 @@ export function createSequences({ state, source, parts }) {
|
||||
state.sequence.loading = false;
|
||||
clearCones();
|
||||
// An error about the sequence goes with it.
|
||||
state.context.actions.reportError(null);
|
||||
reportError(null);
|
||||
requestRender();
|
||||
notify();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user