Skip to main content

Weather Panel

The Weather panel displays current weather conditions for the geographic center of the Cesium map view.

Enabling the Weather Panel

In the sidebar under Live Observation → Weather, click Show Weather. The panel expands to show the current conditions. Click the button again to collapse it.

Displayed Information

FieldDescription
TemperatureCurrent temperature in °C
Condition iconWeather icon from OpenWeatherMap
DescriptionShort text description (e.g., "clear sky", "light rain")
Location nameCity or region name from reverse geocoding

Auto-Update on Pan

When the Weather panel is open and you pan the map, the weather data automatically updates to reflect the new center location. Updates are debounced by 1 second — the fetch only fires after the camera has stopped moving for 1 second, preventing excessive API calls during continuous pan.

How Location is Determined

  1. The current map center pixel is converted to a 3D position using viewer.camera.getPickRay()
  2. The 3D position is converted to lat/lon coordinates
  3. The coordinates are reverse-geocoded to a place name using OSM Nominatim

Data Source

Weather data comes from the OpenWeatherMap Current Weather API:

https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={key}&units=metric

The API key is hardcoded in app.js (not a server-side proxy). Temperature is returned in Celsius (units=metric).

Limitations

  • The OpenWeatherMap API key is currently embedded in the client-side JavaScript. For production use, consider proxying through the server.
  • Weather updates only when the panel is open — data is not cached between panel opens.
  • Over large bodies of water, the updateWeatherPanel() function may fail to resolve a valid location; the panel will retain the last known data.