feat: load history when clicking station markers on map

This commit is contained in:
2026-08-09 17:04:21 +07:00
parent ae5d0a13d7
commit 9ef7798e00
+3 -1
View File
@@ -303,7 +303,9 @@
iconSize: [size, size], iconAnchor: [size / 2, size / 2], popupAnchor: [0, -size / 2] iconSize: [size, size], iconAnchor: [size / 2, size / 2], popupAnchor: [0, -size / 2]
}); });
const marker = L.marker([station.latitude, station.longitude], { icon, title: `${station.station_code} ${station.english_name}` }) const marker = L.marker([station.latitude, station.longitude], { icon, title: `${station.station_code} ${station.english_name}` })
.bindPopup(buildPopup(station, measurement)).addTo(state.map); .bindPopup(buildPopup(station, measurement))
.on('click', () => loadHistory(station.station_code))
.addTo(state.map);
state.layers.push(marker); state.layers.push(marker);
state.markers.set(station.station_code, marker); state.markers.set(station.station_code, marker);
bounds.push([station.latitude, station.longitude]); bounds.push([station.latitude, station.longitude]);