Add code to infer conditions from wind + gusts when Open-Meteo over simplifies weather

This commit is contained in:
mrkmntal 2026-04-13 11:33:11 -04:00
commit 84ae94e052
6 changed files with 94 additions and 14 deletions

View file

@ -1,6 +1,6 @@
import { safePromiseAll } from './fetch.mjs';
import { loadData } from './data-loader.mjs';
import { getSmallIconFromWmoCode } from '../icons.mjs';
import { getSmallIconFromWmoCodeWithWind } from '../icons.mjs';
import { getOpenMeteoObservationSnapshot } from './weather.mjs';
import { temperature } from './units.mjs';
import { withBasePath } from './base-path.mjs';
@ -107,7 +107,12 @@ const selectNearbyCities = (map, sourceLocation, cities, options = {}) => {
const buildNearbyWeatherMarker = (city, observation) => {
const temperatureConverter = temperature();
const icon = getSmallIconFromWmoCode(observation.weatherCode, observation.isDay);
const icon = getSmallIconFromWmoCodeWithWind(
observation.weatherCode,
observation.isDay,
observation.windSpeed,
observation.windGusts
);
const markerHtml = `
<div class="nearby-weather-marker-inner">
<div class="city">${city.name}</div>