Show unbooked flights in orange

Closes: #114
This commit is contained in:
Edward Betts 2024-01-16 17:11:55 +00:00
parent 39f9c98a51
commit 3a7784bb25
3 changed files with 4 additions and 4 deletions

View file

@ -39,14 +39,14 @@ function build_map(map_id, coordinates, routes) {
// Draw routes
routes.forEach(function(route) {
var color = {"train": "blue", "flight": "red"}[route.type];
var color = {"train": "blue", "flight": "red", "unbooked_flight": "orange"}[route.type];
var style = { weight: 3, opacity: 0.5, color: color };
if (route.geojson) {
// If route is defined as GeoJSON
L.geoJSON(JSON.parse(route.geojson), {
style: function(feature) { return style; }
}).addTo(map);
} else if (route.type === "flight") {
} else if (route.type === "flight" || route.type === "unbooked_flight") {
var flightPath = new L.Geodesic([[route.from, route.to]], style).addTo(map);
} else {
// If route is defined by 'from' and 'to' coordinates