Show lines connecting transport stops on map

Closes: #104
This commit is contained in:
Edward Betts 2024-01-12 17:17:12 +00:00
parent 4b8b1f7556
commit e993329939
2 changed files with 33 additions and 0 deletions

View file

@ -93,6 +93,7 @@
<script>
var coordinates = {{ coordinates | tojson }};
var routes = {{ routes | tojson }};
// Initialize the map
var map = L.map('map').fitBounds(coordinates.map(function(station) {
@ -123,6 +124,11 @@ coordinates.forEach(function(item) {
marker.bindPopup(item.name);
});
// Draw lines for routes
routes.forEach(function(route) {
L.polyline(route, {color: 'blue'}).addTo(map);
});
</script>
{% endif %}
{% endblock %}