Change colour of rail journey on map to blue
This commit is contained in:
parent
e2fdd1d198
commit
cb2a2c7fb8
|
@ -130,12 +130,12 @@ routes.forEach(function(route) {
|
||||||
// If route is defined as GeoJSON
|
// If route is defined as GeoJSON
|
||||||
L.geoJSON(JSON.parse(route.geojson), {
|
L.geoJSON(JSON.parse(route.geojson), {
|
||||||
style: function(feature) {
|
style: function(feature) {
|
||||||
return {color: route.type === "train" ? "green" : "blue"}; // Green for trains, blue for flights
|
return {color: route.type === "train" ? "blue" : "blue"}; // Green for trains, blue for flights
|
||||||
}
|
}
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
} else {
|
} else {
|
||||||
// If route is defined by 'from' and 'to' coordinates
|
// If route is defined by 'from' and 'to' coordinates
|
||||||
var color = route.type === "train" ? "green" : "red"; // Green for trains, red for flights
|
var color = route.type === "train" ? "blue" : "red"; // Green for trains, red for flights
|
||||||
L.polyline([route.from, route.to], {color: color}).addTo(map);
|
L.polyline([route.from, route.to], {color: color}).addTo(map);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue