setBase: the last call wins; an overtaken or disposed one changes nothing

A vector setBase awaited its style before changing anything, with no
generation guard, so a slow earlier call landed over a later one, and one
in flight at disposal rejected. Cesium and the stub now count calls like
setPhotoreal and setTerrain, abort the overtaken style load, and resolve
an overtaken call with imagery: [] and settled: false.
This commit is contained in:
Sameh Khamis committed 2026-11-11 19:25:04 -08:00
1 parent 5fae3cf485
commit 72d8dd606d
6 files changed
+196 -7

No files matched your search

+8 -1
View File
@@ -237,7 +237,14 @@ export interface LoadProgress {
export type SettleKind = 'base' | 'tiles' | 'terrain' | 'imagery' | 'surface';
export interface GlobePort {
/** Switch the whole base at once; resolves when the new base has settled. */
/**
* Switch the whole base at once; resolves when the new base has settled.
* The last call wins: one a later `setBase` (or the renderer's disposal)
* overtakes before its base changes (its vector style still loading)
* changes nothing and resolves with `imagery: []`, `settled: false` and the
* photoreal status as it stands, never rejecting; one overtaken after it
* changed the base resolves with `settled: false`.
*/
setBase(base: BaseSpec): Promise<BaseStatus>;
/** `photoreal`: on, off or a new token route. */
setPhotoreal(spec: PhotorealSpec | null): Promise<PhotorealStatus>;