Show flights and trains in different colours

This commit is contained in:
Edward Betts 2024-01-12 19:52:00 +00:00
parent 4b62ec96dc
commit 4e719a07ab
2 changed files with 7 additions and 4 deletions

View file

@ -126,7 +126,8 @@ coordinates.forEach(function(item) {
// Draw lines for routes
routes.forEach(function(route) {
L.polyline(route, {color: 'blue'}).addTo(map);
var color = route[0] === "train" ? "green" : "red"; // Green for trains, red for flights
L.polyline([route[1], route[2]], {color: color}).addTo(map);
});
</script>