View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Sunlight and time controls

Source guide Project README

Integrates sunlight and a time control with Leaflet. Time and map position determine the sun, moon and sky state used by the scene.

Clock to scene

flowchart LR
  Clock["Live / selected time"] --> Sun["updateSun"]
  Center["Map center"] --> Sun
  Sun --> Position["Solar + lunar positions"]
  Position --> Sky["Sky + scene sunlight"]
  Sky --> Render["Request render"]
  Sun --> Event["simulationtimechange"]
  Event --> Traffic["Traffic clock"]

Astronomical calculations live in astronomy; shadows pause below the low-sun threshold.

Related: astronomy, lighting, shadows.