Prefer station labels in nearby map markers

This commit is contained in:
2569718930@qq.com
2026-04-06 11:19:22 +08:00
parent 5117a08057
commit 2e44b40b86
+7 -1
View File
@@ -79,6 +79,12 @@ function createMarkerIcon(
function buildNearbyIconHtml(detail: CityDetail, station: NearbyStation) {
const symbol = detail.temp_symbol || "°C";
const label =
station.station_label ||
station.name ||
station.station_code ||
station.icao ||
"实测 (OBS)";
let windHtml = "";
if (station.wind_dir != null) {
@@ -100,7 +106,7 @@ function buildNearbyIconHtml(detail: CityDetail, station: NearbyStation) {
<div class="pulse-core"></div>
</div>
<div class="nearby-content">
<span class="nearby-label">${station.name || station.icao || "实测 (OBS)"}</span>
<span class="nearby-label">${label}</span>
<div class="nearby-stats">
<span class="nearby-temp-val">${station.temp ?? "--"}</span>
<span class="nearby-temp-unit">${symbol}</span>