Show flights and trains in different colours
This commit is contained in:
parent
4b62ec96dc
commit
4e719a07ab
2 changed files with 7 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue