-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
474 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export function fetchCurrentData(map, route) { | ||
const bounds = map.getBounds(); | ||
const upperLeft = bounds.getNorthWest(); | ||
const lowerRight = bounds.getSouthEast(); | ||
const hostname = window.location.hostname; | ||
const protocol = window.location.protocol; | ||
const port = hostname === "localhost" ? "3001" : "443"; | ||
|
||
return fetch(`${protocol}//${hostname}:${port}/api/${route}/`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
"bounds": { | ||
"upper-left": { | ||
"lat": upperLeft.lat, | ||
"lon": upperLeft.lng | ||
}, | ||
"lower-right": { | ||
"lat": lowerRight.lat, | ||
"lon": lowerRight.lng | ||
} | ||
} | ||
}) | ||
}) | ||
.then(response => response.json()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { useEffect, useRef } from "react"; | ||
import "./css/Banner.css"; | ||
|
||
function Banner() { | ||
return ( | ||
<div className="navbar"> | ||
<div className="brand">Wischen & Mischen</div> | ||
<div className="spacer"></div> {/* This will take up the unused space */} | ||
<div className="nav-items"> | ||
<div className="nav-item"><a href="https://www.youtube.com/watch?v=xvFZjo5PgG0" target="_blank">Home</a></div> | ||
<div className="nav-item"><a href="https://www.youtube.com/watch?v=xvFZjo5PgG0" target="_blank">Data Solutions</a></div> | ||
<div className="nav-item"><a href="https://www.youtube.com/watch?v=xvFZjo5PgG0" target="_blank">About</a></div> | ||
<div className="nav-item"><a href="https://www.youtube.com/watch?v=xvFZjo5PgG0" target="_blank">Contact</a></div> | ||
{/* Add more nav items as needed */} | ||
</div> | ||
</div> | ||
|
||
); | ||
} | ||
|
||
export default Banner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import L from 'leaflet'; | ||
import busIconUrl from '../resources/bus_icon.png'; | ||
import trainIconUrl from '../resources/train_icon.png'; | ||
import tramIconUrl from '../resources/tram_icon.png'; | ||
import subwayIconUrl from '../resources/subway_icon.png'; | ||
import ferryIconUrl from '../resources/ferry_icon.png'; | ||
import expressIconUrl from '../resources/express_icon.png'; | ||
import suburbanIconUrl from '../resources/suburban_icon.png'; | ||
|
||
const busIcon = L.icon({ | ||
iconUrl: busIconUrl, | ||
iconSize: [40, 40], | ||
}); | ||
|
||
const trainIcon = L.icon({ | ||
iconUrl: trainIconUrl, | ||
iconSize: [25, 25], | ||
}); | ||
|
||
const tramIcon = L.icon({ | ||
iconUrl: tramIconUrl, | ||
iconSize: [40, 40], | ||
}); | ||
|
||
const subwayIcon = L.icon({ | ||
iconUrl: subwayIconUrl, | ||
iconSize: [40, 40], | ||
}); | ||
|
||
const ferryIcon = L.icon({ | ||
iconUrl: ferryIconUrl, | ||
iconSize: [40, 40], | ||
}); | ||
|
||
const expressIcon = L.icon({ | ||
iconUrl: expressIconUrl, | ||
iconSize: [40, 40], | ||
}); | ||
|
||
const suburbanIcon = L.icon({ | ||
iconUrl: suburbanIconUrl, | ||
iconSize: [32, 32], | ||
}); | ||
|
||
|
||
export function getIcon(subtype) { | ||
switch (subtype) { | ||
case "suburban": | ||
return suburbanIcon; | ||
case "subway": | ||
return subwayIcon; | ||
case "tram": | ||
return tramIcon; | ||
case "bus": | ||
return busIcon; | ||
case "ferry": | ||
return ferryIcon; | ||
case "express": | ||
return expressIcon; | ||
case "regional": | ||
return trainIcon; | ||
default: | ||
return busIcon; | ||
} | ||
} | ||
|
||
export function getColor(products) { | ||
if (products.suburban) { | ||
return "green"; | ||
} else if (products.subway) { | ||
return "red"; | ||
} else if (products.tram) { | ||
return "blue"; | ||
} else if (products.bus) { | ||
return "yellow"; | ||
} else if (products.ferry) { | ||
return "purple"; | ||
} else { | ||
return "black"; | ||
} | ||
} |
Oops, something went wrong.