Add HKO official observation series for Hong Kong charts

This commit is contained in:
2569718930@qq.com
2026-03-23 21:22:41 +08:00
parent 5e31bc9ea3
commit b1102400f6
4 changed files with 134 additions and 10 deletions
+9 -1
View File
@@ -252,8 +252,10 @@ export function getTemperatureChartData(
const metarObservationSource = detail.metar_today_obs?.length
? detail.metar_today_obs
: detail.trend?.recent || [];
const allowMetarFallback =
settlementSource && observationCode !== "hko";
const shouldUseMetarFallback =
settlementSource &&
allowMetarFallback &&
officialObservationSource.length > 0 &&
officialObservationSource.length < 3 &&
metarObservationSource.length >= 3;
@@ -366,6 +368,12 @@ export function getTemperatureChartData(
? `Official ${observationTag} feed is sparse today, so the continuous observation line switches to ${metarFallbackTag}.`
: `今日官方 ${observationTag} 点位较稀疏,连续实测线改用 ${metarFallbackTag}`,
);
} else if (observationCode === "hko") {
legendParts.push(
isEnglish(locale)
? "Hong Kong uses HKO official readings. The chart keeps official HKO points instead of switching to airport METAR."
: "香港按 HKO 官方读数展示;图中保留 HKO 官方点位,不切换到机场 METAR 连续线。",
);
} else if (observationCode === "noaa") {
legendParts.push(
isEnglish(locale)