OptionalcollapseCollapse the panel to a single sun button when the map container is narrower than this, in CSS pixels. Default 420.
OptionaldefaultStart collapsed to the round ☀ button (expand on click; the header's ▢ re-collapses).
A user-initiated collapse (this option, or clicking ▢) sticks — the responsive
width handler only auto-expands widgets IT collapsed. Default false (expanded).
OptionaldefaultInitial instant to display (a UTC Date). Default: now.
OptionaldefaultInitial on/off state for the master geo-sun switch when there is no system to read it
from. Default true. When a system is provided, its enabled flag wins.
OptionaldefaultInitial state for the Shadows switch when there is no system to read it from. Default false.
When a system is provided, its Atmosphere.shadows wins — the Atmosphere is the source
of truth and the widget is a view onto it.
OptionallocationWhere the sun is evaluated and displayed: a fixed [lng, lat] tuple in degrees, or
'map-center' to track the map center (re-derived on the map's moveend). Default
'map-center'.
OptionalonUI-only mode: invoked on every change with the freshly computed sun state and the instant
it was computed for. Use this to apply lighting yourself when you do not pass a system.
The computed sun state (altitudeDeg/azimuthDeg in degrees — azimuthDeg
is a compass bearing clockwise from north — the unit ENU directionEnu vector and the
twilight phase; see Atmosphere's SunState).
The UTC instant the sun state was computed for.
OptionalshadowsEnable the Shadows toggle. Default false, in which case the toggle is shown
disabled. Set true when the driven system has shadow-casting layers wired
(see each layer's shadows option).
OptionalshowShow the play / animate-through-the-day control. Default true, but it is only active
when a system is provided (it is rendered disabled otherwise).
OptionalshowShow the sun-path arc diagram. Default true.
OptionalsystemThe Atmosphere to drive (the preferred path) — it handles the MapLibre light/sky and the renderer sun for your 3D layers. Required for the play/animate button and the Shadows toggle to have any effect.
Configuration for SunControlWidget. Every field is optional; the defaults give a fully-functional panel tracking the map center with the sun-path arc and animation shown.
Remarks
Provide either
system(the preferred, fully-wired path — the widget drives an Atmosphere that updates the map light/sky and your 3D layers) oronChange(UI-only mode, where you apply theSunStateyourself). With neither, the widget still renders and dispatches the DOMsunchangeevent, but nothing in the scene is relit.