From acd24ea76c4bce0628e226317a4062497ff6393c Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 2 Mar 2025 13:42:25 +0000 Subject: [PATCH] [frontend]: Add all data sources to map --- frontend/src/App.jsx | 3 +++ frontend/src/components/MapComponent.jsx | 8 +++++++- frontend/src/components/Sidebar.jsx | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 66fa369..d709fe0 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -9,6 +9,9 @@ const PERMANENT_DATA_API = "https://a6y312dpuj.execute-api.us-east-1.amazonaws.c const dataSources = [ { id: "IrishRailTrains", name: "Irish Rail Trains", url: `${TRANSIENT_DATA_API}?objectType=IrishRailTrain` }, { id: "IrishRailStations", name: "Irish Rail Stations", url: `${PERMANENT_DATA_API}?objectType=IrishRailStation` }, + { id: "LuasStops", name: "Luas Stops", url: `${PERMANENT_DATA_API}?objectType=LuasStop` }, + { id: "BusStops", name: "Bus Stops", url: `${PERMANENT_DATA_API}?objectType=BusStop` }, + { id: "Buses", name: "Buses", url: `${TRANSIENT_DATA_API}?objectType=Bus` }, ]; function App() { diff --git a/frontend/src/components/MapComponent.jsx b/frontend/src/components/MapComponent.jsx index f3b21b4..00cc2aa 100644 --- a/frontend/src/components/MapComponent.jsx +++ b/frontend/src/components/MapComponent.jsx @@ -8,6 +8,9 @@ import "leaflet.markercluster/dist/MarkerCluster.Default.css"; import trainStationIconURL from "../assets/icons/train-station.png"; import trainIconURL from "../assets/icons/train.png"; +import luasIconURL from "../assets/icons/tram-station.png"; +import busStopIconURL from "../assets/icons/bus-station.png"; +import busIconURL from "../assets/icons/bus.png"; // Fix Leaflet marker icon issue delete L.Icon.Default.prototype._getIconUrl; @@ -19,7 +22,10 @@ L.Icon.Default.mergeOptions({ const icons = new Map([ ["IrishRailStation", new Icon({ iconUrl: trainStationIconURL, iconSize: [24, 24] })], - ["IrishRailTrain", new Icon({ iconUrl: trainIconURL, iconSize: [24, 24] })], + ["IrishRailTrain", new Icon({ iconUrl: trainIconURL, iconSize: [38, 38] })], + ["LuasStop", new Icon({ iconUrl: luasIconURL, iconSize: [38, 38] })], + ["BusStop", new Icon({ iconUrl: busStopIconURL, iconSize: [24, 24] })], + ["Bus", new Icon({ iconUrl: busIconURL, iconSize: [38, 38] })], ]); const MapComponent = ({ markers, clusteringEnabled }) => { diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index 0db7211..bdce037 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -5,6 +5,9 @@ const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setCl const dataSources = [ { id: "IrishRailTrains", name: "Irish Rail Trains" }, { id: "IrishRailStations", name: "Irish Rail Stations" }, + { id: "LuasStops", name: "Luas Stops" }, + { id: "BusStops", name: "Bus Stops" }, + { id: "Buses", name: "Buses", }, ]; return (