Skip to content

spatial-monorepo


spatial-monorepo / core/src / isWithinAdjacentOrdinal

Function: isWithinAdjacentOrdinal()

isWithinAdjacentOrdinal(position, activeOrdinal, levels): boolean

Defined in: packages/core/src/layers/RTLSLayer.ts:86

Issue #110 — Floor culling helper.

Returns true when the asset's levelId corresponds to a floor whose ordinal is within ±1 of the active ordinal. Assets on far-away floors are culled so setFeatureState is never called for them, preventing MapLibre zoom-lag.

Falls back to exact levelId match when no levels array is supplied (backward compat).

Parameters

position

PositionUpdate

activeOrdinal

number

levels

LevelFeature[]

Returns

boolean

Released under commercial licensing.