Skip to content

spatial-monorepo


spatial-monorepo / core/src / useDynamicFocus

Function: useDynamicFocus()

useDynamicFocus(options): void

Defined in: packages/core/src/hooks/useDynamicFocus.ts:27

PRD F14 — Multi-building DynamicFocus campus fan-out.

Zoom behaviour:

  • zoom < 16 : clear active building (show all footprints at campus level)
  • 16 ≤ zoom < 18 : fan-out view — all footprints visible, no auto-selection
  • zoom ≥ 18 : auto-select the building whose centroid is nearest to mapCenter

This hook is a pure synchronous function (no React hooks used) so it can be called from any React hook, effect, or directly in tests without a renderer.

Parameters

options

UseDynamicFocusOptions

Returns

void

Released under commercial licensing.