Skip to content

spatial-monorepo


spatial-monorepo / core/src / FloorUnloaderOptions

Interface: FloorUnloaderOptions

Defined in: packages/core/src/utils/FloorUnloader.ts:21

Properties

delayMs?

optional delayMs?: number | (() => number)

Defined in: packages/core/src/utils/FloorUnloader.ts:32

How long (ms) an off-screen floor waits before being unloaded. Default: 30 000.

May be a static number or a function returning the current value. Pass a function (e.g. one that reads a useRef) when the delay can change after the unloader has been created — it is re-resolved every time a scheduling decision is made, so later changes take effect on the next off-screen floor rather than being frozen at construction time. A resolved value of 0 (or less) disables unloading: any already-pending timer is cancelled and no new timers are started.


getLayerIds

getLayerIds: (ordinal) => string[]

Defined in: packages/core/src/utils/FloorUnloader.ts:34

Returns the layer IDs that belong to a given floor ordinal.

Parameters

ordinal

number

Returns

string[]


reloadFloor?

optional reloadFloor?: (ordinal) => void

Defined in: packages/core/src/utils/FloorUnloader.ts:40

Called synchronously when a previously-unloaded floor becomes active again (i.e. it was evicted after the idle timeout and the user switches back to it). The implementation should re-add the floor's MapLibre sources and layers.

Parameters

ordinal

number

Returns

void

Released under commercial licensing.