The MapLibre map (read for getCenter() when the reference is 'map-center').
See GeoSunSystemOptions.
Add a SunConsumer to the fan-out. It is not back-filled with the last state; call GeoSunSystem.update (or read GeoSunSystem.current) to drive it.
The controller to add.
Dispose every controller that implements SunConsumer.dispose.
Change where the sun is evaluated; takes effect on the next GeoSunSystem.update.
The new SunReference ('map-center' or a fixed { lng, lat } in degrees).
Compute the sun for date and push it to every controller.
The instant to evaluate (a Date, UTC for solar math).
Optionalcenter: { lat: number; lng: number }Optional explicit { lng, lat } in degrees to evaluate at; when
omitted, the configured SunReference is used (map-center or the fixed point).
The new SunState (also retrievable via GeoSunSystem.current).
Computes one SunState per update and fans it out to a set of SunConsumer controllers (MapLibre light/sky/hillshade and the renderers). The fan-out is the structural guarantee behind the cardinal rule: every consumer sees the same SunState object, so MapLibre's light and the renderer's sun can never disagree.
Most consumers should use setTimeOfDay, which builds and wires a
GeoSunSystemfor you. Construct one directly only when you need full control over the controller list.Example