Show accommodation pins on the map

This commit is contained in:
Edward Betts 2024-01-14 21:28:12 +00:00
parent 7ca5eafd1d
commit 1f8d465c6d

View file

@ -104,7 +104,18 @@ def collect_trip_coordinates(trip: Trip) -> list[StrDict]:
continue
stations[s["uic"]] = s
return [
accommodation_coordinates = [
{
"name": accommodation["name"],
"type": "accommodation",
"latitude": accommodation["latitude"],
"longitude": accommodation["longitude"],
}
for accommodation in trip.accommodation
if "latitude" in accommodation and "longitude" in accommodation
]
station_coordinates = [
{
"name": s["name"],
"type": "station",
@ -112,7 +123,9 @@ def collect_trip_coordinates(trip: Trip) -> list[StrDict]:
"longitude": s["longitude"],
}
for s in stations.values()
] + [
]
airport_coordinates = [
{
"name": s["name"],
"type": "airport",
@ -122,6 +135,8 @@ def collect_trip_coordinates(trip: Trip) -> list[StrDict]:
for s in airports.values()
]
return accommodation_coordinates + station_coordinates + airport_coordinates
def latlon_tuple(stop: StrDict) -> tuple[float, float]:
"""Given a transport stop return the lat/lon as a tuple."""