Skip to content

spatial-monorepo


spatial-monorepo / core/src / applyRenderOptions

Function: applyRenderOptions()

applyRenderOptions(map, opts): void

Defined in: packages/core/src/render-options.ts:86

Apply RenderOptions to a MapLibre map by toggling layer visibility.

Each section flag (e.g. walls.render) gates all layers whose id starts with the corresponding prefix. When render is true → 'visible'; false → 'none'. When renderOptions is undefined, this is a no-op.

Issue #479 — walls.alpha, walls.maxHeightCm and walls.showStructuralWalls are additionally applied to every imdf-walls-<levelId> layer currently on the map via setPaintProperty/setFilter — never addLayer/removeLayer, per the "never recreate a MapLibre source or layer on re-render" rule. Each sub-flag is independently optional: a flag left undefined leaves that paint/filter property untouched (matching the existing render no-op contract below).

Parameters

map

Map$1

opts

RenderOptions | undefined

Returns

void

Released under commercial licensing.