feat: load history when clicking station markers on map
This commit is contained in:
@@ -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]);
|
||||||
|
|||||||
Reference in New Issue
Block a user